num = int(input("Enter the Number: ")) for i in range(1, num+1): for j in range(0, num): print(i, end="") print() # This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)