#Consi SecAPrincing = 20 SecBPrincing = 15 SecCPrincing = 10 #Vari SecAprofit = 0 SecBprofit = 0 SecCprofit = 0 TotalProfit = 0 SecASeat = float(raw_input("Please input how many section A seats were sold: \n")) while SecASeat > 300: SecASeat = float(raw_input("Error Seating out of range \n")) SecBSeat = float(raw_input("Please input how many section B seats were sold: \n")) while SecBSeat > 500: SecBSeat = float(raw_input("Error Seating out of range \n")) SecCSeat = float(raw_input("Please input how many section C seats were sold: \n")) while SecCSeat > 200: SecCSeat = float(raw_input("Error Seating out of range \n")) SecAprofit = SecASeat * SecAPrincing SecBprofit = SecBSeat * SecBPrincing SecCprofit = SecCSeat * SecCPrincing TotalProfit = SecAprofit + SecBprofit + SecCprofit print("The total profit is ${}".format(TotalProfit))
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