Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #funciones
- def inversa(l):
- tipo=type(l)
- temp=[]
- for i in l:
- temp.insert(0, i)
- temp
- if tipo == str:
- temp=''
- for i in l:
- temp+=i
- temp
- return temp
- #main
- print('\n|Ej 6|')
- listaNum=[1, 2, 3, 4, 5, 6]
- print(f'\nInversa de lista numerica ({listaNum}) -> {inversa(listaNum)}')
- cadena='Gaston'
- print(f'\nInversa de string ({cadena}) -> {inversa(cadena)}')
- print('\nFin de la ejecucion!\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement