#Software sale company quantity = 0 total = 0 price = 99 discountTotal = 0 discountOne = 0.8 discountTwo = 0.7 discountThree = 0.6 discountFour = 0.5 quantity = input(" Please enter the quuntity of your packages purchased:\n") if quantity < 10: total = quantity * price discountTotal = quantity * price - total print "The price for", quantity, "items is $", total, "\n" elif quantity >= 10 and quantity < 20: total = quantity * price * discountOne discountTotal = quantity * price - total print "The price for", quantity, "items is $", total, "\n" elif quantity >= 20 and quantity < 50: total = quantity * price * discountTwo discountTotal = quantity * price - total print "The price for", quantity, "items is $", total, "\n" elif quantity >= 50 and quantity < 100: total = quantity * price * discountThree discountTotal = quantity * price - total print "The price for", quantity, "items is $", total, "\n" elif quantity >= 100 and quantity < 101: total = quantity * price * discountFour discountTotal = quantity * price - total print "The price for", quantity, "items is $", total, "\n"
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