Advertisement
kamakwazee

Exercise 7

Feb 9th, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class Main:
  2.  
  3.     def __init__(self):
  4.         mpg = float(raw_input("Enter mileage in miles per gallon: "))
  5.         metric = self.convert_mileage(mpg)
  6.         print("Your mileage is " + str(metric) + " L/100km.")
  7.  
  8.     def convert_mileage(self,mpg):
  9.         lk = (100 * 3.7854)/(1.6093 * float(mpg))
  10.         return lk
  11.        
  12. Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement