def totalIncome(a, b, c): return (a*20)+(b*15)+(c*10) sectionA=input('How many tickets were sold in section A?') while sectionA>300: print "\nThe maximum amount of seats in section A is 300, Please try again." sectionA=input('\nHow many tickets were sold in section A?') sectionB=input('\nHow many tickets were sold in section B?') while sectionB>500: print "\nThe maximum amount of seats in section B is 500, Please try again." sectionA=input('\nHow many tickets were sold in section A?') sectionC=input('\nHow many tickets were sold in section C?') while sectionC>200: print "\nThe maximum amount of seats in section A is 300, Please try again." sectionA=input('\nHow many tickets were sold in section A?') print "\nThe total sales amount for today is: ${} " .format(totalIncome(sectionA,sectionB,sectionC))
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