Python – weird number counter printer thingie

Question:

numbers = int(input())

Hi,
I was also given this homework python thingie to do. I am supposed to solve it using some loop or cycle. But I am really lost, because I have no idea, how to solve it. Can someone of you please help me.

"Read a string containing only digits from the input. Print to the output a string that contains each digit from the input as many times as the value of the digit."

Input: 25104

Output: 225555514444

Asked By: Proxim17y

||

Answers:

You can use a for loop:

for number in str(numbers):
    print(number * int(number), end='')
Answered By: Peter Wood
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.