(code)print
print "This program calculates a car mileage"
print "and its cost for a price range"
print
distance = float(raw_input("How many miles were measured ? "))
print
consumed = float(raw_input("How many gallons of gas were consumed ? "))
mpg = distance / consumed
print
print "mileage is", mpg, "miles per gallon"
print
# the while instruction tells the computer to "loop" through
# all indented lines below it "while" something is true
#
# in this case it will loop while the gallon price is lower then US$ 2.49
gallon_price = 2.20
while gallon_price < 2.49:
cost = gallon_price / mpg
print 'When the gallon price is US$', gallon_price,
print "the cost is US$", cost, "per mile"
# here we raise the gallon price
gallon_price = gallon_price + 0.05
print(/code)
this is wat im working on, its from the tutorial on
http://programming-crash-course.com/the_while_loop. on this one were adding the "while loop"
can the last line wich adds"+0.05" to price be put ex: before "while loop"? or does it have to be after?