Python 2.7.6 help with modules

Chris Angelico rosuav at gmail.com
Sat Feb 8 00:12:13 EST 2014


On Sat, Feb 8, 2014 at 3:44 PM, Scott W Dunning <swdunning at cox.net> wrote:
> I have a question that was a part of my homework and I got it correct but
> the teacher urged me to do it using the % sign rather than subtracting
> everything, for some reason I’m having issues getting it to calculate
> correctly.

Oh by the way... Your subject line says "modules", but the % operator
calculates "modulo". Modules are sections of Python-callable code -
there's a "sys" module, a "math" module, and so on - and you can call
them up with the "import" statement:

import sys
import math

etc. Modulo means remainder (a bit of handwaving there - look it up on
Wikipedia if you care about the specifics), which is what you're doing
here.

ChrisA



More information about the Python-list mailing list