aSeats=20 bSeats=15 cSeats=10 aSold=input("Please enter the amount of tickets sold for seating section A") print salesA=aSeats*aSold if aSold<0 or aSold>300: A=0 print "You entered {} seats sold, The max capacity of section A is 300 seats".format(aSold) print "Please try again, enter a number between 0 and 300" else: print "The number of seats sold in section A is {}, for ${:,.2f}".format(aSold,salesA) A=1 bSold=input("Please enter the number of tickets sold for seating section B") print salesB=bSeats*bSold if bSold<0 or bSold>500: B=0 print "You entered {} seats sold, The max capacity of section B is 500 seats".format(bSold) print "Please try again, Enter a number between 0 and 500" else: print "The number of seats sold in section B is {}, for ${:,.2f}".format(bSold,salesB) B=1 cSold=input("Please enter the number of tickets sold for seating section C") print salesC=cSeats*cSold if cSold<0 or cSold>200: C=0 print "You entered {} seats sold, the max capacity for section C is 200 seats".format(cSold) print "Please try again, Enter a number between 0 and 200" else: print "The number of seats sold in section C is {}, for ${:,.2f}".format(cSold,salesC) C=1 totalSales=salesA+salesB+salesC if A==1 and B==1 and C==1: print "The total amount of sales for tonight is ${:,.2f}".format(totalSales) else: print "Something went wrong or you entered incorrect info" print "Please try again"
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