I am fairly new to the more 'intermediate' concepts in python. To recap what I've 'learned', I decided to make a combination generator. Basically, you give some input then it should return every combination of it. (e.g. I type in 'mark' and it should return 'kram', 'makr' etc.)
But I suspect that there's a problem with the 'combinations' function, I cant quite figure it out why.
from itertools import combinations
def combo_generator():
user_string = {}
for l in input("Enter a string for combo: "):
combo = combinations(user_string, 8)
user_string[l] = 1
if user_string[l] >= 8:
print("Too much strings! Enter less than 10 letters.")
combo_generator()
else:
print(list(combo))
combo_generator()
Because here is the broken output:
Enter a string for combo: "mark"
[]
[]
[]
[]
Any help will do. Thanks.