Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
Created January 18, 2012 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KartikTalwar/1630170 to your computer and use it in GitHub Desktop.
Save KartikTalwar/1630170 to your computer and use it in GitHub Desktop.
String Combinations
def stringCombinations(string, right = ''):
if not string:
print right
return
stringCombinations(string[1:], string[0] + right)
stringCombinations(string[1:], right)
stringCombinations('abcd')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment