Advertisement
Sergio_Istea

listas_varias_concatenaciones.py

Apr 13th, 2023
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. lista = [ "casa", "Perro", 5, "Arbol", 5, "Sol" ]
  4.  
  5.  
  6. #suma = lista[2] + lista[4]
  7.  
  8. #ouput = str(suma) + " " + lista[3]
  9.  
  10. #ouput = str(lista[2] + lista[4]) + " " + lista[3]
  11.  
  12. #output = f'{suma} {lista[3]}'
  13.  
  14. output = f'{lista[2] + lista[4]} {lista[3]}'
  15.  
  16.  
  17.  
  18.  
  19. print(output)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement