PackagesPurch=input('Please enter the number of packages purchased') print(PackagesPurch) PurchBeforeDisc=(PackagesPurch * 99) print('This is your total before discount') print(PurchBeforeDisc) if(PackagesPurch <10): print('You are not eligible for a discount') elif(PackagesPurch >=10 and PackagesPurch <=19): Discount1=PurchBeforeDisc * .2 print('This is your discount') print(Discount1) print('This is the total amount of your purchase') print(PurchBeforeDisc - Discount1) elif(PackagesPurch >=20 and PackagesPurch <=49): Discount2=PurchBeforeDisc * .3 print('This is your discount') print(Discount2) print('This is the total amount of your purchase') print(PurchBeforeDisc - Discount2) elif(PackagesPurch >=50 and PackagesPurch <=99): Discount3=PurchBeforeDisc * .4 print('This is your discount') print(Discount3) print('This is the total amount of your pucahse') print(PurchBeforeDisc - Discount3) elif(PackagesPurch >=100): Discount4=PurchBeforeDisc * .5 print('This is your discount') print(Discount4) print('This is the total amount of your purchase') print(PurchBeforeDisc - Discount4)
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