Issues with 6/15: is_prime (Solved!)


edit: After a bit of searching and some fixing up of my code, the issue is now solved!


Your code never does anything really.
The user gives you a number to check if its prime
and you have a function that says, how about I check 6 instead.


Thanks for replying.

The reason I “checked 6 instead” was because when first attempting this on Codecademy, it kept telling me X was 0, or something… So I decided to give X a preassigned value.

Any insight on why that is, or why I’m receiving the error in the OP?


Sorry, can you please explain why you have a while and a for loop?


My understanding is that ‘for’ is used in order to create ranges, where as ‘while’ will run calculations until a certain condition is met.

I’d love to learn a bit more about loops from you. If you could please explain why I shouldn’t be using both ‘for’ and ‘while’ loops, that’d be great!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.