a = input("Please enter how many tickets were sold in Section A: ") print a b = input("Please enter how many tickets were sold in Section B: ") print b c = input("Please enter how many tickets were sold in Section C: ") print c while a > 300: a = input("Error: There are only 300 seats in Section A. Please enter the amount of tickets sold again: ") print a while b > 500: b = input("Error: There are only 500 seats in Section B. Please enter the amount of ticekts sold again: ") print b while c > 200: c = input("Error: There are only 200 seats in Section C. Please enter the amount of tickets sold again: ") print c finalA = 20 * a finalB = 15 * b finalC = 10 * c final = finalA + finalB + finalC print "The gross amount of ticket sales is $""{:.2f}".format(final) + "."
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