cannot understand the mistake


you will need a special if condition to check for values below 2, the loop won't cover it

A function ends the moment a return keyword is reached, so your function ends the first run of the loop, that can't be right, we can't determine a number is a prime number in the first run of the loop


ok thank you, it turned out to be indentation issue..
it is a For and else.. added a elif statement for 2
thank you very much...


yes, but this indention issue is important, do you understand why?


yes.. hitting return the loop stopped .....thank you.. now i have started understanding how nested loops function.. ..


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