Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 17th, 2018 75 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. N = int(input("Введите количество списков в списке:"))
  2. arr = [ list(input("Введите числа во вложенном списке:")) for i in range (N)]
  3. print("Полученный список списков:",arr)
  4. d = len(arr)
  5. m = list()
  6. try:
  7.     for i in range(d):
  8.         b = arr.pop(i)
  9.         print("Вложенный список",b)
  10.         d = list(b)
  11.         d = max(b)
  12.         m.append(d)
  13.         print(m)
  14. except:
  15.     print("перебор элементов закончился")
  16.    
  17. In [27]: items = [[1,2,3], [4,7,2],[0,-7,1]]
  18.  
  19. In [28]: res = list(map(max, zip(*items)))
  20.  
  21. In [29]: print(res)
  22. [4, 7, 3]
  23.    
  24. In [30]: print(list(zip(*items)))
  25. [(1, 4, 0), (2, 7, -7), (3, 2, 1)]
  26.    
  27. arr = [list(map(int, input("Введите числа во вложенном списке:").split()))
  28.        for i in range (N)]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top