Skip to content

Instantly share code, notes, and snippets.

@frankhn
Created March 23, 2020 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankhn/b167c32413ef3d5d86a30b3e91e7eb16 to your computer and use it in GitHub Desktop.
Save frankhn/b167c32413ef3d5d86a30b3e91e7eb16 to your computer and use it in GitHub Desktop.
number_list = [1, 2, 3]
str_list = ['one', 'two', 'three']
classes = ['middle', 'high', 'junior']
# No iterables are passed
# result = zip()
# Converting itertor to list
# result_list = list(result)
# print(result_list)
# Two iterables are passed
result = zip(number_list, str_list, classes)
# Converting itertor to set
# result_set = set(result)
print(list(result))
for number, string_, class_ in zip(number_list, str_list, classes):
print(number, string_, class_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment