Miles = float(raw_input("enter how many miles you have to travel: ")) #This allows the reader to answer a question print Miles,", how many miles ar you traveling?" #This allows the creator to ask a question Mpg = float (raw_input("enter how many mpg you are using: ")) #This allows the reader to answer a question print Mpg,", how many mpg are you using?" #This allows the creator to ask a question Gallons = float(Miles/Mpg) #This inserts the equation to allow the fiddle to dothe math print Gallons #This allows the creator to sum up the section of the fiddle Price = float(raw_input("enter how much a gallon will cost: ")) #This allows the reader to answer a question print Price,", how much does the trip cost?" #This allows the creator to ask a question Cost = float(Gallons*Price) #This inserts the equation to allow the fiddle to dothe math print Cost #This allows the creator to sum up the section of the fiddle
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question