Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2014 02:09
Show Gist options
  • Save anonymous/93c5c2b26c252471a480 to your computer and use it in GitHub Desktop.
Save anonymous/93c5c2b26c252471a480 to your computer and use it in GitHub Desktop.
def main():
#Declare
price = 99
quantity = float(input("How many packages have you purchased?"))
if quantity >= 10:
print ("Your discount is 20%.")
print ("Your total is ", quantity * price - quantity * price * .2)
else:
if quantity >= 20:
print ("Your discount is 30%. ")
print ("Your total is ", quantity * price - quantity * price *.3)
else:
if quantity >= 50:
print ("Your discount is 40%.")
print ("Your total is ", quantity * price - quantity * price * .4)
else:
if quantity >= 100:
print ("Your discount is 50%. ")
print ("Your total is ", quantity * price - quantity * price * .5)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment