- #1
shivajikobardan
- 674
- 54
Here is the code that I am talking about-:
If I give n=5 output should be 2,3,5.
Here is my dry run. Everything is fine except for 2 where I am not getting 2 as output. What has gone wrong here? I don't understand what is gone wrong here?
Code:
n=int(input("Enter a number"))
for num in range(2,n+1):
for i in range(2,num):
if(num%i==0):
break
else:
print(num,end="")
If I give n=5 output should be 2,3,5.
Here is my dry run. Everything is fine except for 2 where I am not getting 2 as output. What has gone wrong here? I don't understand what is gone wrong here?