Re: [Tutor] python qn

2014-09-11 Thread Peter Otten
Carmel O'Shannessy wrote: > times = ['50.319468', '50.319468', 't1'] > > I want to convert [0:2] to floats. > > I tried: > > float.times = [float(i) for i in times[:2]] > > but get the error msg: > > TypeError: can't set attributes of built-in/extension type 'float' Try times[:2] = [floa

Re: [Tutor] python qn

2014-09-11 Thread Danny Yoo
On Thu, Sep 11, 2014 at 8:08 AM, Carmel O'Shannessy wrote: > > Hello, > > times = ['50.319468', '50.319468', 't1'] > > I want to convert [0:2] to floats. > > I tried: > > float.times = [float(i) for i in times[:2]] Hi Carmel, Do you intend to have a variable named "float.times" here on the le

[Tutor] python qn

2014-09-11 Thread Carmel O'Shannessy
Hello, times = ['50.319468', '50.319468', 't1'] I want to convert [0:2] to floats. I tried: float.times = [float(i) for i in times[:2]] but get the error msg: TypeError: can't set attributes of built-in/extension type 'float' Carmel -- -- Carmel O'Shannessy, Assoc. Prof. Department of