python - I am having trouble getting my function to return a global varriable -


traceback (most recent call final): file "c: \ user \ mitch \ document \ lab3.py" In line 18, the main () file contains "C: \ user \ Mitch \ document \ lab3.py", line 15, the main find in the calculation (volume) file "C: \ Users \ Mitch \ Documents \ lab3.py" In line 2, if the quantity> = 1 and volume

  def finddiscount (discount): If the quantity & gt; = 1 more volume & lt; = 9: discount = "0%" alip volume & gt; = 10 more quantity & lt; = 1: discount = "20%" alip volume & gt; = 20 more quantity & lt; = 49: discount = "30%" elif volume & gt; = 50 more quantity & lt; = 99: discount = "40%" elif quantity & gt; = 100: discount = "50%" print (discount) def (main): Quantity = int (Input ("How many packages have been bought?") Finddiscount (Quantity) value = Float (Input ("How much is each item? ") Try main  

 < Code> def finddiscount (quantity): # Do not discount!  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -