print "This program calculates revenue from theater ticket sales." aCost = 20 bCost = 15 cCost = 10 aTicketsSold = input("Please enter the number of Section A seats sold: ") while aTicketsSold < 0 or aTicketsSold > 300: aTicketsSold = input("Please enter a value from 0 to 300. Try again: ") bTicketsSold = input("Please enter the number of Section B seats sold: ") while bTicketsSold < 0 or bTicketsSold > 500: bTicketsSold = input("Please enter a value from 0 to 500. Try again: ") cTicketsSold = input("Please enter the number of Section C seats sold: ") while cTicketsSold < 0 or cTicketsSold > 200: cTicketsSold = input("Please enter a value from 0 to 200. Try again: ") aRevenue = aCost * aTicketsSold bRevenue = bCost * bTicketsSold cRevenue = cCost * cTicketsSold totalRevenue = aRevenue + bRevenue + cRevenue print ("Total revenue from tickets sales is: ") print totalRevenue
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