[Tutor] Bad Operand Type

Stephan Richter srichter@cbu.edu
Sun, 24 Sep 2000 23:35:14 -0500


Daniel,

I think you need to convert the input (string) to a float.

>milesTraveled = raw_input("How many miles did you travel? ")
>gallonsUsed = raw_input("How many gallons of gas did you use? ")
>pricePerGallon = raw_input("How much did one gallon of gas cost? ")

float(milesTraveled) = raw_input("How many miles did you travel? ")
float(gallonsUsed) = raw_input("How many gallons of gas did you use? ")
float(pricePerGallon) = raw_input("How much did one gallon of gas cost? ")

That should solve your problem.

Regards,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management