Advertisement
Guest User

Untitled

a guest
Nov 19th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. pies = {
  2.     'species': 'pieseł',
  3.     'name': 'felek',
  4.     'owner_first': 'ania',
  5.     'owner_last': 'brzęczyszczykiewicz',
  6.     'age': 3,
  7.     }
  8.  
  9. kot = {
  10.     'species': 'kotełek',
  11.     'name': 'dakarrr',
  12.     'owner_first': 'małgosia',
  13.     'owner_last': 'skowronek',
  14.     'age': 1,
  15.     }
  16.  
  17. szympans = {
  18.     'species': 'małpełe',
  19.     'name': 'czikita',
  20.     'owner_first': 'daniel',
  21.     'owner_last': 'petarda',
  22.     'age': 7,
  23.     }
  24.  
  25. animals = [pies, kot, szympans]
  26.  
  27. for zwierz in animals:
  28.     for key, value in zwierz.items():
  29.         owner_full = f"{key['owner_first']} {key['owner_last']}"
  30.         print(f"{owner_full.title()}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement