sectionA = int(raw_input("Enter the number of tickets sold in section A\n")) while sectionA <= 0 or sectionA >= 300: sectionA = int(raw_input("Error: There are only 300 seats available in section A. Please try again\n")) sectionB = int(raw_input("Enter the number of tickets sold in section B\n")) while sectionB <= 0 or sectionB >= 500: sectionB = int(raw_input("Error: There are only 500 seats available in section B. Please try again\n")) sectionC = int(raw_input("Enter the number of tickets sold in section C\n")) while sectionC <=0 or sectionC >= 200: sectionC = int(raw_input("Error: There are only 200 seats available in section C. Please try again\n")) seatA=20 seatB=15 seatC=10 ticketSales=(sectionA*seatA)+(sectionB*seatB)+(sectionC*seatC) print("The total ticket sales were ${:,.2f}" .format(ticketSales))
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