Skip to content

Instantly share code, notes, and snippets.

@robertlugg
Created July 27, 2020 19:55
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 robertlugg/40a05fce04504d2c3c5dff1bef647237 to your computer and use it in GitHub Desktop.
Save robertlugg/40a05fce04504d2c3c5dff1bef647237 to your computer and use it in GitHub Desktop.
Example iterating through multiple lists
list_column_a = [1, 11, 22, 33]
list_column_b = ['one', 'eleven', 'twenty two', 'thirty three']
list_column_c = ['exciting', 'blah', 'somewhat ok', 'fishy']
for idx, a in enumerate(list_column_a):
print(f"{a}, {list_column_b[idx]}, {list_column_c[idx]}")
for a, b, c in zip(list_column_a, list_column_b, list_column_c):
print(f"{a}, {b}, {c}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment