Created
April 16, 2014 00:01
-
-
Save Xpktro/10791062 to your computer and use it in GitHub Desktop.
Academic Excercises with Python (in spanish)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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