Re: [Tutor] BMI Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 7:25 PM, Dwight Hutto wrote: > On Mon, Sep 24, 2012 at 7:13 PM, Alan Gauld wrote: >> On 24/09/12 20:13, Aija Thompson wrote: >>> >>> Hi! >>> >>> So I've been working on this question for hours! And Python keeps giving >>> me an error saying that my syntax for BMI is wrong.

Re: [Tutor] BMI Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 7:13 PM, Alan Gauld wrote: > On 24/09/12 20:13, Aija Thompson wrote: >> >> Hi! >> >> So I've been working on this question for hours! And Python keeps giving >> me an error saying that my syntax for BMI is wrong. I really can't >> understand why. > > I'd suggest an editor,

Re: [Tutor] BMI Question

2012-09-24 Thread Alan Gauld
On 24/09/12 20:13, Aija Thompson wrote: Hi! So I've been working on this question for hours! And Python keeps giving me an error saying that my syntax for BMI is wrong. I really can't understand why. So send us the full error text not a summary. If Python reports a syntax its usually recorde

Re: [Tutor] BMI Question

2012-09-24 Thread Prasad, Ramit
Aija Thompson wrote: > Hi! > > So I've been working on this question for hours! And Python keeps giving me an > error saying that my syntax for BMI is wrong. I really can't understand why. > > So this is what I have so far: One suggestion: immediately convert to appropriate number type instead

Re: [Tutor] BMI Question

2012-09-24 Thread eryksun
On Mon, Sep 24, 2012 at 3:13 PM, Aija Thompson wrote: > > ft, inches = h. split("'") > h_sum = float(12*int(ft)) + (int(inches.strip('"')) Leave h_sum as an int: h_sum = 12 * int(ft) + int(inches.strip('"')) A better name here would be "h_inch". Also, make sure your parentheses are closed.

Re: [Tutor] BMI Question

2012-09-24 Thread Stephen Haywood
On Sep 24, 2012, at 3:16 PM, Aija Thompson wrote: Hi! So I've been working on this question for hours! And Python keeps giving me an error saying that my syntax for BMI is wrong. I really can't understand why. So this is what I have so far: w = raw_input('Please give your weight in lbs: ') h

[Tutor] BMI Question

2012-09-24 Thread Aija Thompson
Hi! So I've been working on this question for hours! And Python keeps giving me an error saying that my syntax for BMI is wrong. I really can't understand why. So this is what I have so far: w = raw_input('Please give your weight in lbs: ')h = raw_input('Now your height in feet and inches: ')h.