Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65707 > unrolled thread

Re: Python 2.7.6 help with modules

Started byScott W Dunning <swdunning@cox.net>
First post2014-02-08 17:28 -0700
Last post2014-02-08 17:28 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python 2.7.6 help with modules Scott W Dunning <swdunning@cox.net> - 2014-02-08 17:28 -0700

#65707 — Re: Python 2.7.6 help with modules

FromScott W Dunning <swdunning@cox.net>
Date2014-02-08 17:28 -0700
SubjectRe: Python 2.7.6 help with modules
Message-ID<mailman.6558.1391910757.18130.python-list@python.org>
On Feb 7, 2014, at 11:29 PM, Chris Angelico <rosuav@gmail.com> wrote
> 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.

So, this is more like what you’re talking about?

>>> first = number / 10
>>> second = number % 10
>>> last = first %10
>>> rest = second / 10

I feel stupid saying this and it’s probably because of the variables I’m using but I’m not sure what the above is doing.  For some reason it’s confusing me.  I used the number 55664, so the variable (first) is saying take 55664 and / it by 10, then (second) is saying take the original number divide it by 10 and spit out the remainder?  Then from there (last) is saying take the original number / it by 10 then take that number and divide it by 10 again and give me the remainder?  Then finally (rest) is saying take the remainder of the original number after dividing by ten and divide that number by 10? I guess I’m confused on the result I’m looking for.

I know I’m asking very elementary questions so I really do appreciate not only all of your help but, your patients too!!

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web