#Carlos SOlano, Assignment 6, program 2 Theater #prompt user print "Hello and welcome to the theater !" print "We have three different sections at different prices." print "Section A cost $20 each(Only 300 seats available)." print "Section B cost $15 each(Only 500 seats available)." print "Section C cost $10 each(Only 200 seats available)." #get info section A secA = raw_input("How many section A tickets were sold?: ") secA = int(secA) while (secA < 0 or secA > 300): secA = raw_input("Please enter a valid number of tickets sold: ") secA = int(secA) print secA soldSecA = secA * 20 print ("Total section A sales: $"), soldSecA #get info section B secB = raw_input("How many section B tickets were sold?: ") secB = int(secB) while (secB < 0 or secB > 500): secB = raw_input("Please enter a valid number of tickets sold: ") secB = int(secB) print secB soldSecB = secB * 15 print ("Total section B sales: $"), soldSecB #get info section C secC = raw_input("How many section C tickets were sold?: ") secC = int(secC) while (secC < 0 or secC > 200): secC = raw_input("Please enter a valid number of tickets sold: ") secC = int(secC) print secC soldSecC = secC * 10 print ("Total section C sales: $"), soldSecC #show total sales allSales = soldSecA + soldSecB + soldSecC print "The total sales are: $", allSales
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