Hey I'm new to programming and I have been working on calculating miles per 
gallon. iv posted below what I have and constructive criticism would be 
wonderful. Thanks

#This is a program used to calculate miles per gallon


#variable used to gather miles driven 
string_miles = input('How many miles did you drive?')

#variable used to gather the amount of gallons used 
string_gas = input('How many gallons of gas did you use?')

#used to convert the miles input
miles = int(string_miles)

#used to convert the gas input
gas = int(string_gas)

#used to calculate mpg through division
mpg = miles/gas

print(float(string_miles))
print(float(string_gas))
print('Your miles per gallon is', format(mpg,'.2f'))
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to