Page 1 of 1

Python: Creating a Dictionary with Two Lists

Posted: Tue Apr 07, 2026 5:18 pm
by Jason

Code: Select all

print("Top Three Finalists in the Race:")

keys = ['1', '2', '3']

values = ['tortoise', 'hare', 'penguin']

dictionary_of_race_finalists = dic(zip(keys, values))

for d in dictionary_of_race_finalists:

print(d)