I have to solve this exercise using recursion.
Implement a function in Python which recieves as parameters list of characters and an integer n. The function has to print all the possible combinations in the length of n, where every character can be shown more than one time.
It's very mind-blowing for me, all this thinking recursively generally.
For example, for this problem, I think already one and a half hour, not knowing what I'm thinking about. I don't know how to start thinking recursively, what am I starting from?
I have written some nonsense:
def print_sequences(char_list, n):
if len(char_list) == 1:
print(char_list[1])
else:
sub_str = ""
for c in char_list:
print_sequences(list(sub_str + c), n)
Please help me develop some sense of recursion.