def hotel_cost(nights): return nights * 140 def plane_ride_cost(city): print type(city) if city == "Charlotte": print 183 elif city == "Tampa": print 220 elif city == "Los Angeles": print 475 elif "Pittsburgh": print 222 else: print "Choose a different city?" plane_ride_cost("Charlotte") plane_ride_cost("Pittsburgh") plane_ride_cost("Tampa") plane_ride_cost("Los Angeles") plane_ride_cost("New Orleans")
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