Considering taking a hammer to the computer...

Chris Angelico rosuav at gmail.com
Tue Jan 1 17:01:12 EST 2013


On Wed, Jan 2, 2013 at 7:14 AM,  <worldsbiggestsabresfan at gmail.com> 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



More information about the Python-list mailing list