Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.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: UNSURE 0.277 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.45; '*S*': 0.00; 'scaling': 0.07; 'subject:Help': 0.11; 'quoted': 0.16; 'sec': 0.16; 'units.': 0.16; 'uppercase': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'feb': 0.22; 'to:name:python- list@python.org': 0.22; 'error': 0.23; 'case.': 0.24; 'hours,': 0.24; 'define': 0.26; 'this:': 0.26; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'especially': 0.30; 'message- id:@mail.gmail.com': 0.30; 'constant': 0.31; 'subject:some': 0.31; 'everyone': 0.33; 'subject:with': 0.35; 'one,': 0.35; 'received:google.com': 0.35; 'cancel': 0.36; 'should': 0.36; 'seconds': 0.37; 'two': 0.37; 'list': 0.37; 'clear': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'quote': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'units': 0.60; 'conversion': 0.61; 'lower': 0.61; 'you.': 0.62; 'reach': 0.63; 'name': 0.63; 'different': 0.65; 'holding': 0.65; 'situation': 0.65; 'hours': 0.66; 'here': 0.66; 'reply': 0.66; 'minutes': 0.67; 'side': 0.67; 'benefit': 0.68; 'email addr:python.org"': 0.68; 'equals': 0.68; 'upper': 0.74; 'hand': 0.80; 'trial': 0.83; 'individual.': 0.84; 'time)': 0.91; 'whereas': 0.91; 'scott': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3P6EZRm0+Hi8//LwfQCqg1ChXyw5uAAbOC9EtIGO92g=; b=QzwWn0pcexzGInuBXm3DomiVurhNEIYUoGtpIz0i4HcMuQYJKiqYyADC+n/LL/hhSa H86IriAqu9AcLaNkeMymnxxY0/bAKXWok7K9zM7J0p7H1p5RS93kLq/eX6HgvQWzmtlQ 7bIonbzKVGYbM7+JiKmlf9uOEaCNIVpfkYgTEnerLgsEO534sSCob/5CrSnnffL9+MqR mjIuFoxf/vNaO+EEBoORdhrhRBfQWfS4sSDSuaZUz5nbsvzvf5LBsE1jL/O0cDjR10QU vhQV0VdTX+VKgswb6v1jrpA0mW8EtIasLZuyMp//jbIvQrmCyFA9j6igdf4YnM9u8Io7 3lZg== MIME-Version: 1.0 X-Received: by 10.220.191.134 with SMTP id dm6mr19147211vcb.16.1391224678401; Fri, 31 Jan 2014 19:17:58 -0800 (PST) In-Reply-To: References: <02c4c69d-71f1-4a01-86df-d4d5a7ffb3f5@googlegroups.com> <8da5d692-1446-4107-9a5a-5efd91f7c051@googlegroups.com> <2B1086E7-5E5F-4227-8F9E-92A37D2DE1D2@cox.net> Date: Sat, 1 Feb 2014 14:17:58 +1100 Subject: Re: Help with some python homework... From: David To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Sat, 01 Feb 2014 06:32:59 +0100 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391232780 news.xs4all.nl 2903 [2001:888:2000:d::a6]:40182 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65185 On 1 February 2014 12:34, Chris Angelico wrote: > On Sat, Feb 1, 2014 at 12:14 PM, Scott W Dunning wrote: > >> Also, I think I found out through a little trial and error that I had two different hours, mins, and sec so I had to use one uppercase and one lower case. Is that frowned upon? And should I have come up with a different name instead? >> >> SECONDS = 1 >> MINUTES = 60 * SECONDS >> HOURS = 60 * MINUTES What is actually being defined here are constants to be used for scaling or conversion of some quantity (a time) into different units. So in this situation would I define the conversion constant with an upper case name like this: SECONDS_PER_MINUTE = 60 and I would use it like this seconds = minutes * SECONDS_PER_MINUTE where "seconds" and "minutes" are the names holding the numeric data. That line has the extra benefit that it is clear to me why the units are seconds on both sides of the equals sign (because on the right hand side the minute-units cancel thus: m*s/m=s), whereas this is much less clear to me in Scott's line. Scott's message quoted above did not reach me, only Chris's quote of it, so I say: Scott once you begin a discussion on a mailing list like this one, please make sure that every reply you make goes to "python-list@python.org" and not to the individual. That way we can all participate in the discussion, that is best for everyone especially you.