> The second version works.
>
> print "Total trip cost is US$", float(distance) /
> (float(mpg) * float(galon_price))
Hi Matt,
Although this works, we'll probably want to do the type conversions as
early as possible. We can write a function input_float() that wraps up
the float(raw_input()) stuff:
###################################
def input_float(prompt):
return float(raw_input(prompt))
###################################
If we have this as a helper function, then we don't have to worry about
sprinkling float() conversions all over the place.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor