Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'assigning': 0.09; 'calculating': 0.09; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'jan': 0.12; '00:00:00': 0.16; '__future__': 0.16; 'integers,': 0.16; 'remainder': 0.16; 'unnecessary.': 0.16; 'subject:python': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'received:10.0.1': 0.19; '>>>': 0.22; 'cc:addr:python.org': 0.22; '31,': 0.24; 'instead.': 0.24; 'versions': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'cool': 0.30; 'url:mailman': 0.30; 'gives': 0.31; 'too.': 0.31; 'division': 0.31; 'subject:some': 0.31; 'url:python': 0.33; 'fri,': 0.33; 'subject:with': 0.35; 'no,': 0.35; 'done': 0.36; 'url:listinfo': 0.36; 'charset:us-ascii': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'should': 0.36; 'seconds': 0.37; 'received:10': 0.37; 'pm,': 0.38; 'rather': 0.38; 'short': 0.38; 'does': 0.39; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'header :Message-Id:1': 0.63; '(that': 0.65; 'to:addr:gmail.com': 0.65; 'hours': 0.66; '2014,': 0.84; 'received:68.230.241.237': 0.84 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020204.52EC42E8.00C4,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=BJhtWisG c=1 sm=1 a=MB85R812cvcrhCHz/P2OVA==:17 a=lYmbDxrgSswA:10 a=G8Uczd0VNMoA:10 a=kj9zAlcOel0A:10 a=kviXuzpPAAAA:8 a=IFej2vUWUj8A:10 a=pGLkceISAAAA:8 a=8AHkEIZyAAAA:8 a=I0Kl1ZfD2TeTG0wChdMA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=MB85R812cvcrhCHz/P2OVA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=swdunning@cox.net Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Help with some python homework... From: Scott W Dunning In-Reply-To: Date: Fri, 31 Jan 2014 17:42:15 -0700 Content-Transfer-Encoding: quoted-printable References: <02c4c69d-71f1-4a01-86df-d4d5a7ffb3f5@googlegroups.com> <8da5d692-1446-4107-9a5a-5efd91f7c051@googlegroups.com> To: Chris Angelico X-Mailer: Apple Mail (2.1827) X-Mailman-Approved-At: Sat, 01 Feb 2014 06:35:37 +0100 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391232938 news.xs4all.nl 2967 [2001:888:2000:d::a6]:43316 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65192 Also, any help on how to get the hours and seconds into double digits = that would be cool too. 00:00:00 On Jan 31, 2014, at 1:30 AM, Chris Angelico wrote: > On Fri, Jan 31, 2014 at 7:17 PM, Gregory Ewing > wrote: >> sjud9227 wrote: >>>=20 >>> Doesn't >>> assigning seconds/(60*60) mean that calculating 6*hours will give me = 6 >>> hours >>> in seconds? >>=20 >> No, it's giving you 6 seconds in hours. (That should >> give you a clue as to what you should have done >> instead. :-) >>=20 >> ... >>=20 >> a // b gives the quotient of dividing a by b >>=20 >> a % b gives the remainder >>=20 >> (I recommend using '//' rather than just '/', because >> in some versions of Python, a/b does floating point >> division even if a and b are both integers, and that's >> not what you want here.) >=20 > OP is using 2.7.6, so short of a __future__ directive, that won't > actually give 6 seconds in hours (though it will try to), and // is > unnecessary. >=20 > ChrisA > --=20 > https://mail.python.org/mailman/listinfo/python-list