Skip to content

Commit

Permalink
chapter 6 finished
Browse files Browse the repository at this point in the history
  • Loading branch information
BenHollamby committed Mar 19, 2021
1 parent 0541cdc commit e0a9ae9
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Chapter 6 Dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,32 @@
print(f"{name} is the coolest {of_type}")

################################################################
#continue on page 171

print("\n")

favourite_places = {
'ben': ['antarctica', 'russia', 'siberia'],
'aaron': ['australia', 'nz'],
'alice': ['ireland', 'south america']
}

for name, places in favourite_places.items():
print(f"{name.title()}'s favourite places are:")
for place in places:
print(f"\t{place.title()}")

##################################################

print("\n")

fav_numbers = {
'aaron': [30, 45, 50],
'ben': [18, 21, 25, 28],
'alice': [25, 30, 33]
}

for name, numbers in fav_numbers.items():
print(f"{name.title()}'s favourite numbers are:")
for number in numbers:
print(f"\t{number}")

0 comments on commit e0a9ae9

Please sign in to comment.