Issues with 6/15: is_prime (Solved!)


#1

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


#2

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.


#3

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?


#4

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


#5

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!


#6

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