#try to avoid input function a = int(input("Enter any number :")) b = "" for i in range(1,a+1): b = b+" "+str(i) print(i,end=" ") print(b)
Click the run button. Try to avoid input() function.