#What is the issue here? (Im a beginner)
18 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
@shut mural
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
i don't think "else return true" is supposed to be inside the loop
think about it:
if you call, say, isprime(5) then on the first time through the loop it checks if (number % j == 0) return false; else return true
and that's if (5 % 3 == 0) return false; else return true
so it will always return after checking if it's divisible by 3
@ashen mural ok so i deleted it but there still is an error, here is my whole code btw
well now if the loop ends you never return anything
why
sorry i dont understand it, should i add anything to my code then?
because there are no return statements
should I add return true; at the end?
not inside for loop
what do you think