[EMAIL PROTECTED] (administrata) wrote in message news:[EMAIL PROTECTED]...
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
I'm confused with division :/
Please help me...
administrata wrote:
sry, i don't know much about maths
What is % used for?
such as?
Among many other things, you can use it to test whether one integer
evenly divides another integer.
For example, to test if a number is odd:
def isodd(x):
return bool(x % 2)
--
Robert Kern
[EMAIL PROTECTED]
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
I'm confused with division :/
Please help me...
thx 4 reading.
--
http://mail.python.org/mailman/listinfo/python-list
administrata on 2005-02-10 09:38:41 -0800:
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
I'm confused with division :/
It's not division; the division operator is '/'. It's
On Thu, 10 Feb 2005 09:41:07 -0800 (PST), administrata
[EMAIL PROTECTED] wrote:
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I hope you are enjoying it. ;-_
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
It;'s modular
On 2005-02-10, administrata [EMAIL PROTECTED] wrote:
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
It's the modulus operator. It returns the remainder of integer
division. As we used to say in second grade:
4 goes into 107 26 times with 3 left over.
3 goes into 4 2 times
administrata a écrit :
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
it's the modulo operator (if you don't remember, the modulo is the
remaining of the integer division, ie 5 % 2 = 1)
administrata wrote:
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
I'm confused with division :/
Please help me...
thx 4 reading.
% means modulus, which is simply, the remainder of A
In article [EMAIL PROTECTED], administrata wrote:
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
That's the modulo operation; it returns the remainder, rather than the quotient.
--
zoerhoff(AT)sdf.lonestar.org
kristian.zoerhoff(AT)gmail.com
--
administrata wrote:
Hi! it's been about a week learning python!
I've read 'python programming for the absolute begginer'
I don't understand about % like...
107 % 4 = 3
7 % 3 = 1
I'm confused with division :/
Please help me...
thx 4 reading.
% is the remainder operator (I think it's also called
Grant Edwards wrote:
It's the modulus operator. It returns the remainder of integer
division. As we used to say in second grade:
4 goes into 107 26 times with 3 left over.
3 goes into 4 2 times with 1 left over.
How long were you stuck in second grade, Grant? grin
-Peter
P.S. You're
On 2005-02-10, Peter Hansen [EMAIL PROTECTED] wrote:
Grant Edwards wrote:
It's the modulus operator. It returns the remainder of integer
division. As we used to say in second grade:
4 goes into 107 26 times with 3 left over.
3 goes into 4 2 times with 1 left over.
How long were you
Harlin wrote:
In the mode of anticipating another question... I get these all the
time at work of all places! You'd think IT workers would know the
answer to these...
What good is the modulus operator? What would I ever need it for?
# Print a summary every 100 rows
for i in range(1, 1001):
Harlin wrote:
What good is the modulus operator? What would I ever need it for?
* A quick way of testing whether an integer is even and odd
* For that matter, a quick way of testing whether a the variable is a
factor of any other arbitrary number.
* In some programs (a weight control program I
14 matches
Mail list logo