Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jessica = {'first_name' : 'Jessica'
- , 'last_name' : 'Alvarez'
- , 'location' : 'princeton'
- }
- timmy = {'first_name' : 'Timmy'
- , 'last_name' : 'Turner'
- , 'location' : 'Mexico'
- }
- people = [jessica, timmy]
- for person in people:
- print("Full name: " + person['first_name'].title() + " " + person['last_name'].title())
- print("Location: " + person['location'].title() + "\n")
- apple = {'kind' : 'cat'
- , 'owner' : 'jessica'
- }
- whitey = {'kind' : 'dog'
- , 'owner' : 'timmy'
- }
- pets = [apple, whitey]
- for pet in pets:
- print(pet['owner'].title() + "'s pet is a " + pet['kind'].title())
- favplaces = {'timmy' : ['rome']
- , 'jessica' : ['madrid', 'paris']
- , 'jason' : ['pennsylvania', 'london', 'ikkebukuro']
- }
- print('')
- for name, place in favplaces.items():
- if len(place) == 1:
- print(name.title() + "'s favorite place is " + place[0].title())
- elif len(place) == 2:
- print(name.title() + "'s favorite places are "
- + place[0].title() + " and "
- + place[1].title()
- )
- else:
- print(name.title() + "'s favorite places are "
- + place[0].title() + ", "
- + place[1].title() + ", and "
- + place[2].title()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement