Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def palindroma(s):
- #@param s: str
- #@return: bool
- lung = len(s)
- if lung<=1:
- return True
- else:
- med = int(lung/2)
- if lung%2==0:
- return s[med] == s[med-1] and palindroma(s[:med]+s[med+1:])
- else:
- return palindroma(s[:med]+s[med+1:])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement