Advertisement
Guest User

Untitled

a guest
Feb 7th, 2023
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. countries_capitals = {'Poland': 'Warsaw', 'Germany': 'Berlin'}
  2.  
  3. countries_capitals['Czechia'] = 'Prague'
  4.  
  5. #print(countries_and_capitals)
  6.  
  7. for key in countries_capitals.keys():
  8. print(key)
  9.  
  10. print(countries_capitals["Poland"])
  11. print(countries_capitals.get("Poland"))
  12.  
  13. print(countries_capitals.setdefault(("USA", "Washington DC")))
  14.  
  15. if "Poland" in countries_capitals.keys():
  16. print("Znaleziono!")
  17. else:
  18. print("Nie znaleziono!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement