Last active
December 21, 2015 10:19
-
-
Save zs1621/6291586 to your computer and use it in GitHub Desktop.
why the check_palin() function return 'None', not True or False
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 check_palin(lister): | |
if len(lister) <= 1 : | |
print 'True' | |
return True | |
else: | |
if lister[0] == lister[-1]: | |
lister.pop() | |
del lister[0] | |
check_palin(lister) | |
else: | |
print 'False' | |
return False | |
def remove_white(string): | |
a = [] | |
for i in string: | |
if i != ' ': | |
a.append(i) | |
return a | |
print check_palin(remove_white('y - akay')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
explain