O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

8-2. Favorite Book:

From

Cover of Python Crash Course

Note

dic = dict(jesse='wikipedia', mark='bible')
def display_favorite(favorite):
"""display favorite books"""
for name in favorite.keys():
print(name.title() + "'s favorite book is " + favorite[name].title() + ".")

display_favorite(dic)