Generate the same n digits for each digit

Read in 2 positive integers A and B, 1<=A<=9, 1<=B<=10, generate numbers AA...A, a total of B A

Input format:

Enter A and B in one line.

Output format:

Output integers AA...A in one line, a total of B A

Input example 1:

Here is a set of inputs. E.g:

1, 5
Output example 1:

The corresponding output is given here. E.g:

11111
input example 2:

Here is a set of inputs. E.g:

    3  ,4

Output sample 2:

The corresponding output is given here. E.g:

3333

def num(A, B):
    t = 0
    for i in range(1, B + 1):
        t = t * 10 + A
    return t
A, B = map (int,input().split(','))
print(num(A,B))

Guess you like

Origin blog.csdn.net/m0_46407213/article/details/109144849