python 2.4

how do I say... if x is divisible by (random number) then: in python coding?!? Thanks!!!

if (x % n) == 0 :

but what does the zero stand for in that????

Shouldn't it just be if x % n then???? Help me out it didn't work :-((

The % operator is used to return the remainder if one number were to be divided by another. So 5 % 2 would return 1, because 2 goes into 5 twice, with 1 left over. Another example is 10 % 2 which would return 2. 4 goes in twice, with 2 left over.
So x % n == 0 just means that there is no remainder (it fits perfectly).
Hope that helped!

why don't you upgrade to 2.5? I'm curious if there is special feature or just you love it!

Sorry, I don't understand you. What are you trying to say about Python 2.5? It's what I use, even though Python 2.6 is out now (or the early releases for 3.0).

Sorry, I don't understand you. What are you trying to say about Python 2.5? It's what I use, even though Python 2.6 is out now (or the early releases for 3.0).

I believe his question was in regards to the OP.

He was asking why he is still using 2.4 instead of 2.5 or later. And then he asked if he stuck with 2.4 because of a "special function"... I think

This question has already been answered. Start a new discussion instead.