n= int(raw_input("Number? "))
for x in range (2, n+1):
for y in range (2, x+1):
if x < n+1 and x % 2.0 > 0 and x % 3.0 > 0 and x%y > 0:
print x
x = x + 1
Hello there. I need to create a SIMPLE python program, which lists all the prime numbers up to and inclusive of the input number. For example, if you input 10, it would produce 2, 3, 5 ,7
I'd prefer to keep it simple, and do not use more advanced functions such as def, break. Nested loops are PREFERED.
The code above does NOT work, it contains non-primes such as 25 and 91.
Please help!