How can I solve this problem?
I just know that for separating numbers we should do this, I think:
num = int(input) while num > 0: res = num // 10 num = num % 10
One way to do it is to keep the number as a string, then in a loop convert the first digit to an int, print it n times, then remove it. Repeat the loop until the string is empty:
num = input("Input a number: ") while len(num) > 0: digit = num for i in range(int(digit)): print(digit, end="") num = num[1:]