teslariu

dicc

Sep 10th, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4.  
  5. dicc = {"black":"negro", "white":"blanco", "red":"rojo"}
  6. personas = {
  7.         35222222:"Juan Perez",
  8.         35645645:"Ana Ertyu",
  9.         45855552:"Juan Ponce"
  10.     }
  11.  
  12.  
  13. print(dicc)
  14.  
  15. claves = list(dicc.keys())
  16. print(claves)
  17.  
  18. valores = list(dicc.values())
  19. print(valores)
  20.  
  21. print()
  22.  
  23. for clave, valor in dicc.items():
  24.     print(clave, valor)
  25.  
  26. print(f"DNI     Nombre")
  27. for dni,nombre in personas.items():
  28.     print(f"{dni}   {nombre}")
  29.  
  30.  
Add Comment
Please, Sign In to add comment