def mealCalc(): print ("Calculating the total cost of your meal, including tip and taxes.") meal = int(raw_input("How much was your meal?\n")) print ("Your meal costs: $" meal "Your tip is: $\n" tip "Your tax cost is: $" tax "Your total cost is: $" totalCost) tipLv = int(raw_input("How was your server on a scale from 1 to 3, where 1 is the worst and 3 is the best.\n")) if tipLv == 1: tip = meal*0.05 tipLv = 0 elif tipLv == 2: tip = meal*0.1 tipLv = 0 elif tipLv == 3: tip = meal*0.15 tipLv = 0 //unfinished
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