My task is to make 3 dictionaries to store information about 3 people I know, such as their first name, last name, age, and the city in which they live:
Sissel = {'first_name': 'Sissel', 'last_name': 'Johnsen', 'age': '23', 'city': 'Copenhagen'}
David = {'first_name': 'David', 'last_name': 'Hansen', 'age': '35', 'city': 'Randers'}
Olivia = {'first_name': 'Olivia', 'last_name': 'Petersen', 'age': '57', 'city': 'New York'}
Then I had to store them in a list:
people = [Sissel, David, Olivia]
I have to loop through my list of people. And as I loop through the list, it has to print everything I know about each person by printing the key and associated values in each dictionary.
I tried using a for loop:
for k, v in people:
print(k, v)
But I just got an error message saying
ValueError: too many values to unpack (expected 2)