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


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

Re: Python 2.7.6 help with modules

Started byScott W Dunning <swdunning@cox.net>
First post2014-02-09 21:31 -0700
Last post2014-02-09 21:31 -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-09 21:31 -0700

#65800 — Re: Python 2.7.6 help with modules

FromScott W Dunning <swdunning@cox.net>
Date2014-02-09 21:31 -0700
SubjectRe: Python 2.7.6 help with modules
Message-ID<mailman.6612.1392006674.18130.python-list@python.org>
On Feb 8, 2014, at 11:30 PM, Chris Angelico <rosuav@gmail.com> wrote:
OH, I think I figured it out.  

> time = int(raw_input("Enter number of seconds: “))
1000000
> seconds = time % 60
Remainder of 40 <- for seconds.
> time /= 60
Here you take 1000000/60 = 16666 (which = time for the next line).
> minutes = time % 60
16666/60 with a remainder of 46 <- minutes
> time /= 60
Then take 16666/60 = 277 (which = time for the line below to use).
> hours = time % 24
Then we use 277/24 with a remainder of 13 <- hours
> time /= 24
Then it use 277/24…….. 
> days = time % 7
> time /= 7
> weeks = time

I guess I answered my own question and it looks like it wouldn’t matter if you did it opposite from weeks to seconds.  

Thanks again for all your help everyone!

Scott

[toc] | [standalone]


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


csiph-web