Python 2.7.6 help with modules

Chris Angelico rosuav at gmail.com
Sat Feb 8 01:29:47 EST 2014


On Sat, Feb 8, 2014 at 5:27 PM, Scott W Dunning <swdunning at cox.net> wrote:
> Ok, so it this what you’re talking about?
>
>
> number = int(raw_input(“Enter a five digit number:))
> foo = number % 10
> bar = number / 10
>
> digit = foo / 10
> rem = bar % 10
>

Close! But if you print out foo and bar, you'll see that you're naming
them backwards in the second one. The last digit is the remainder
(modulo), the rest is the quotient.

ChrisA



More information about the Python-list mailing list