Created
July 23, 2017 09:15
-
-
Save isagalaev/47c1dd5e74eb1bdb00daef722f08ef66 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
DICT = {'hi', 'there', 'hit', 'here'} | |
def camelcase(tail, head=''): | |
heads = [head.title()] if head in DICT else [] | |
return ([h + t for h in heads for t in camelcase(tail)] + camelcase(tail[1:], head + tail[0]) | |
if tail else heads) | |
print(camelcase('hithere')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment