Quiz Catalog

Catalog of quizzes

str = 'abc'
num = (10, 20, 30, 40)

a = list(zip(str, num))

print(a)
[('a', 10), ('b', 20), ('c', 30)]
  • build-in/zip
  • build-in/list
  • tuple/literal

first, second = zip(*[(1, 4), (2, 5), (3, 6)])

print(first, second)
(1, 2, 3) (4, 5, 6)
  • build-in/zip
  • list/literal
  • tuple/literal