how to test modulo?

i tried to tst result from modulo

like this

if jj%2=0

but get an error

how can you write this with a if expression ?


I’m a java guy but in java we have double =… like if jj%2==0.

Also try not to shorten variable names like ‘g’ or ‘jj’, try giving proper name as ‘luckyNumber’ or something.

got it working ok

if jj%2==0:



not certain why i t was refusing before
may be due to another error before this line

but now seems ok


single “=” means assignment,
double : " == " means comparison