Advertisement
Guest User

Untitled

a guest
Aug 17th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. '''
  2. Python Crash Course 6-11
  3. Favorite Cities - P112
  4. '''
  5.  
  6. fav_cities = {
  7.     'minneapolis' : {
  8.         'location' : 'minnesota',
  9.         'flower' : 'ladyslipper',
  10.         'duck duck' : 'grey duck',
  11.         'climate' : 'seasonal',
  12.     },
  13.     'nassau' : {
  14.         'location' : 'bahamas',
  15.         'climate' : 'temperate',
  16.         'duck duck' : 'you got a stutter?',
  17.     },
  18.     'tokyo' : {
  19.         'location' : 'japan',
  20.         'language' : 'japanese',
  21.         'climate' : 'seasonal',
  22.     },
  23. }
  24.  
  25. citylist = []
  26. cityinfo = []
  27. snippets = []
  28. x = 0
  29.  
  30. for fave in fav_cities.keys():
  31.     citylist.append(fave)
  32.  
  33. for city in citylist:
  34.     print(city.title())
  35.     if city in fav_cities.keys():
  36.         print(fav_cities[x][location])
  37.         x = (x + 1)
  38.         print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement