Question on if, while, for.... Figured it out..
Paul Rubin
phr-n2002a at nightsong.com
Mon Feb 11 17:40:17 EST 2002
More information about the Python-list mailing list
Mon Feb 11 17:40:17 EST 2002
- Previous message (by thread): Question on if, while, for.... Figured it out..
- Next message (by thread): Question on if, while, for.... Figured it out..
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Steve Holden" <sholden at holdenweb.com> writes: > > if num > den: #Test for improper fraction. > > i = num/den #This will only return the whole part. > > j = num%den #This will return only the remainder. > > > Rather than comment the usage of "i" and "j", why not just use "d" for > dividend and "r" for remainder? The idea behind being able to choose > variable names is to allow them to have some mnemonic significance. I think Steve means quotient and remainder, not divident and remainder. You might also like to error-check the input: what happens if den==0?
- Previous message (by thread): Question on if, while, for.... Figured it out..
- Next message (by thread): Question on if, while, for.... Figured it out..
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list