Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. print(*zip(map(lambda x: list(map(int, input().split())), range(int(input())))))
  2.  
  3. 2
  4. 0 0
  5. 1 1
  6.  
  7. (0, 1) (0, 1)
  8.  
  9. ([0, 0],) ([1, 1],)
  10.  
  11. print(*zip(*map(lambda x: list(map(int, input().split())), range(int(input())))))
  12. # ^ <--- NOTE
  13.  
  14. (0, 1) (0, 1)
  15.  
  16. In [159]: list(zip([[0, 0], [1,1]]))
  17. Out[159]: [([0, 0],), ([1, 1],)] # то что получилось
  18.  
  19. In [160]: list(zip([0, 0], [1,1]))
  20. Out[160]: [(0, 1), (0, 1)] # то что нужно получить
  21.  
  22. In [161]: list(zip(*[[0, 0], [1,1]])) # решение
  23. Out[161]: [(0, 1), (0, 1)]
Add Comment
Please, Sign In to add comment