aSeats = int(input("Enter the number of seats sold in Section A: ")) print(aSeats) while aSeats > 300: print("Error: There are only 300 seats in the A Section, are you oversold?") aSeats = int(input("Enter the number of seats sold in Section A: ")) print(aSeats) bSeats = int(input("Enter the number of seats sold in Section B: ")) print(bSeats) while bSeats > 500: print("Error: There are only 500 seats in the B Section, are you oversold?") bSeats = int(input("Enter the number of seats sold in Section B: ")) print(bSeats) cSeats = int(input("Enter the number of seats sold in Section C: ")) print(cSeats) while cSeats > 200: print("Error: There are only 200 seats in the C Section, are you oversold?") aSeats = int(input("Enter the number of seats sold in Section C: ")) print(cSeats) aTotal = 20 * aSeats bTotal = 15 * bSeats cTotal = 10 * cSeats totalSold = aTotal + bTotal + cTotal print("The current ticket sale income is ${:,.2f}".format(totalSold))
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