[N00B] What's %?

Alec Berryman alec at thened.net
Thu Feb 10 12:47:24 EST 2005


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 the mod
function, which returns the remainder - for example, 7 divided by 3 is
2 remainder 1, so 7 % 3 returns 1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 193 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050210/280fdc26/attachment.sig>


More information about the Python-list mailing list