Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Def check_halves(s)
- S1=s[0:len(s)//2
- S2=s[len(s)//2:len(s)
- If not s1 or s2:
- Return 0
- Elif len(s1) == 1 and len(s2) == 1 and s1 == s2:
- Return 1
- Elif s1[0] != s2[0]:
- Return 0
- Else:
- Return check_halves(s1[1:]+s2[1:])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement