String Repeat Pattern ProgramId - 13586

Solution in Python:

s=input().strip()
n=list(map(int,input()))
i=0
for j in n:
    print(s[:i+1]*j)
    i+=1

Make sure you understand this, if no raise your questions in comment section below...