Hi so I'm working with python and I'm trying to write a method where given a string, it would find every combination of that string and append it to a list. I'll give the string and show the outcome that I want.
string: x = 'god'
outcome:
lst = ['g', 'o', 'd', 'go', 'gd', 'og', 'od', 'dg', 'do', 'god', 'gdo', 'ogd', 'odg', 'dgo', 'dog']
A letter can only be used by the number of times it appears on the string given, so if our string is 'god', 'gg' or 'goo' etc. cannot be appended. If this could be done using recursion that would be great!