Advertisement
Sergio_Istea

paises.py

Apr 13th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. #lista de paises
  4. paises = ["Argentina", "Brasil", "Chile", "Uruguay"]
  5.  
  6. #actualizo tercer elemento
  7. paises[2] = "Perú"
  8.  
  9. #Agrego un pais
  10. # a continuacion se concatenan dos listas
  11. output = paises + ["Paraguay", "Ecuador"]
  12.  
  13. # Unimos 3 listas
  14. output2 = [ "mexico", "honduras"] + paises + ["Paraguay", "Ecuador"]
  15.  
  16. #imprime
  17. print(output)
  18. print(output2)
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement