[Tutor] rows and columns
Gregor Lingl
glingl@aon.at
Sun, 10 Feb 2002 20:49:55 +0100
----- Original Message -----
From: "Gregor Lingl" <glingl@aon.at>
To: <tutor@python.org>; <kp87@lycos.com>; "Charlie Clark"
<charlie@begeistert.org>
Sent: Sunday, February 10, 2002 8:06 PM
Subject: Re: [Tutor] rows and columns
> Nice, except that I think Kevin additionally wanted this:
>
> """if row begins with 'foo' then
> convert the second value in each row to a number, add 0.5 to it
> and turn back to a string"""
> if columns[0]=='foo':
> columns[1] = str(float(columns[1] + 0.5)) <=*ERROR*==
>
>
Huuuh!
The line
> columns[1] = str(float(columns[1] + 0.5))
will not work! Should read:
columns[1] = str(float(columns[1]) + 0.5)
Sorry, Gregor