Advertisement
JohnLedPar

Invertir Lista 2 by Syneztro

Dec 14th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def Invertir(lista):
  2.  
  3. salir = False
  4.  
  5. lista2 =[]
  6.  
  7. items = len(lista)
  8.  
  9. items = items - 1
  10.  
  11. while salir == False:
  12.  
  13. lista2.append(lista[items])
  14.  
  15. items = items - 1
  16.  
  17. if items < 0:
  18.  
  19. salir = True
  20.  
  21.  
  22.  
  23. print(lista2)
  24.  
  25. abecedario = ['a', 'b', 'c', 'd','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
  26.  
  27. Invertir(abecedario)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement