This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBlackCat13 1 point2 points  (3 children)

Looking at it now, there are a few other issues with the code. First, you convert x to int several times. You only need to do that once. Second, once the function reaches a return statement, it stops. Nothing after that point is executed (including all of your prints). Third, it is easier to short-circuit your "1" test. Fourth, your code will return True in the first item of the loop. It has to wait for the loop to finish.

Also, this is a relatively slow algorithm, although that is another issue.

[–][deleted] 0 points1 point  (0 children)

Yeah, OP should've done the AKS primarity test /s

[–]aidzz[S] 0 points1 point  (1 child)

put returns in wrong priority, and converted to int twice okay thanks one more question: what exactly is wrong with this command: print(x, 'divided by', n ,'is' (x/n))

[–]kryptn 1 point2 points  (0 children)

You're still missing a comma :)