Skip to content

Instantly share code, notes, and snippets.

@frankhn
Created March 23, 2020 09:30
Show Gist options
  • Save frankhn/0cbe16f044753ae79e95b4a2eaeedc7b to your computer and use it in GitHub Desktop.
Save frankhn/0cbe16f044753ae79e95b4a2eaeedc7b 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