Created
July 27, 2020 19:55
-
-
Save robertlugg/40a05fce04504d2c3c5dff1bef647237 to your computer and use it in GitHub Desktop.
Example iterating through multiple lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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