Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.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.256 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.52; '*S*': 0.03; 'zero.': 0.09; 'wed,': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'jan': 0.18; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'easiest': 0.27; 'chris': 0.28; 'worked': 0.30; '(and': 0.32; 'adjust': 0.33; 'hotels': 0.33; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'side': 0.61; 'subject:...': 0.63; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; '2013': 0.84; 'actually,': 0.84; 'divide': 0.84; 'received:74.208.4.194': 0.84; 'rooms': 0.84 Date: Tue, 01 Jan 2013 17:34:26 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Considering taking a hammer to the computer... References: <2f5053ab-a646-49d3-a569-61468f518b9f@googlegroups.com> <39abb4d2-277a-4ac9-8574-0d3e3751b7ef@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:VuOTE3KKU3RAgHjxom8lPfEjfo/KkXw6zrB3mF2Nbey EW/ZuJtVWKaEx7YtsQfy9sz5icPaB1IDMF/X0WDSDW8QgHTxy9 ip/FDfMgv97yTidkH5/fk7kObIKIiATPoFLdKCB93N7RMlzvFW BUckDmpegpTJRvG4hA4zSVeRBcyU6sppa9X3bcYMhvMiJkWX5P NtoCB9UyG6KRJPGkRWWNvCmHZzH2fcfYcN3dqepFLGnNEXEbnF vleeYUj3ASp4gHjTAdVNKC8S5vHVMIacXPvRqRJ1jP/MK575lk 2XPsJaZ4g/moP+rF8UQD2znUu5lUZk4N3QJKr3044flHMDmzg= = X-Mailman-Approved-At: Wed, 02 Jan 2013 01:05:11 +0100 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357085113 news.xs4all.nl 6873 [2001:888:2000:d::a6]:56462 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35937 On 01/01/2013 05:01 PM, Chris Angelico wrote: > On Wed, Jan 2, 2013 at 7:14 AM, wrote: >> floor_number = 0 >> for i in range(number_of_floors): >> floor_number = floor_number + 1 > Matt's already given you the part you need (and it seems to have > worked for you, yay!). Side point: Are you aware that i and > floor_number are always going to have the same value? You can simplify > this down to: > > for floor_number in range(number_of_floors): > > ChrisA Actually, floor_number is one higher. The easiest way to fix that is to adjust the range() parms. for floor_number in range(1, 1+number_of_floors): Naturally, in some hotels that might not have any rooms on one of the floors. Divide by zero. -- DaveA