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


Groups > comp.lang.python > #65800

Re: Python 2.7.6 help with modules

Subject Re: Python 2.7.6 help with modules
From Scott W Dunning <swdunning@cox.net>
Date 2014-02-09 21:31 -0700
References <032F2E23-6983-4710-B087-C1771B66C3EF@cox.net> <635C857D-1F7A-4F95-B3A7-F1A3C69BF137@cox.net> <1DA52F3B-CE00-4E47-BE84-C07482966FD7@cox.net> <F4033A14-BA16-4897-9998-65D431B5071C@cox.net> <Q6YW1n0063bjUJS016YX8V>
Newsgroups comp.lang.python
Message-ID <mailman.6612.1392006674.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python 2.7.6 help with modules Scott W Dunning <swdunning@cox.net> - 2014-02-09 21:31 -0700

csiph-web