#What is the issue here? (Im a beginner)

18 messages · Page 1 of 1 (latest)

shut mural
#

How can I change my code so it will work?

bleak bridgeBOT
#

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

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

ashen mural
#

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

shut mural
#

@ashen mural ok so i deleted it but there still is an error, here is my whole code btw

ashen mural
shut mural
#

sorry i dont understand it, should i add anything to my code then?

ashen mural
shut mural
#

not inside for loop

ashen mural
shut mural
#

thx