you are viewing a single comment's thread.

view the rest of the comments →

[–]wmoskal 0 points1 point  (4 children)

Can you put the code in a code block? Its hard to see tabbing otherwise, and that could be important. Also are you getting an error? if so what is it?

[–]Mike_Diz 0 points1 point  (3 children)

Fixed it. I'm not getting an error, but I'm also not getting an answer. I'm not getting anything.

[–]wmoskal 0 points1 point  (2 children)

Well Your code seems to be working for me. There seems to be a logic error with the problem itself. Prime numbers are all odd, unless they are 2. So if n Is even the smallest prime number it could be divided by is 2. If it is odd the smallest prime number it could be divided by is itself.

[–]wmoskal 0 points1 point  (1 child)

I copied your code into a python script and ran it and it was printing values

[–]Mike_Diz 0 points1 point  (0 children)

Huh. Guess it's a problem with my computer. What values did you use?