#try to avoid input function a = int(input("Enter any number :")) for i in range(2,a+1): sf = 0 for j in range(2,i+1): if i%j == 0: sf = sf+1 if sf == 1: print(i,end=" ")
Click the run button. Try to avoid input() function.