Advertisement
ZeroSeventty

Solución palíndrome (Lisanny)

Oct 16th, 2020
2,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def palindrome(lista):
  2.     for n, elemento in enumerate(lista):
  3.         if elemento[::-1] == elemento:
  4.             print(f"[{n}-{elemento}] es palindrome.")
  5.         else:
  6.             print(f"[{n}-{elemento}] NO es palindrome.")
  7.  
  8. lista = ["ana","antonio",77,"oso"]
  9. palindrome(lista)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement