Skip to content

Instantly share code, notes, and snippets.

@Xpktro
Created April 16, 2014 00:01
Show Gist options
  • Save Xpktro/10791062 to your computer and use it in GitHub Desktop.
Save Xpktro/10791062 to your computer and use it in GitHub Desktop.
Academic Excercises with Python (in spanish)
def capicua(numero):
numero = str(numero)
if numero == '' or len(numero) == 1:
return True
elif numero[0] == numero[-1]:
return capicua(numero[1:-1])
return False
print capicua(123321)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment