|
First - I have no idea what Python is.
Second - that means I have no idea of it's syntax.
BUT -
As Spock would say "Logic suggest..."
This code you posted:
if (i % j) == 0:
print j,
else:
if j == i + 1:
print "is a Prime"
IF it prints j, you will never go to the else. Logic is logic -
if (true) then do this ELSE do this - you need to change this so it looks at each separately or looks at the second within the if
if (true) then
print j
if (true) then
print "is a Prime"
|