Skip to content

Instantly share code, notes, and snippets.

@zs1621
Last active December 21, 2015 10:19
Show Gist options
  • Save zs1621/6291586 to your computer and use it in GitHub Desktop.
Save zs1621/6291586 to your computer and use it in GitHub Desktop.
why the check_palin() function return 'None', not True or False
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'))
@zs1621
Copy link
Author

zs1621 commented Nov 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment