python - error with function missing a positional argument -


I am getting an error in my program that explains that discovery () fails a required positional logic Can not seem to figure out how to properly detect discount function code can someone please help? I'm sure this is a simple error but I'm new to Python and especially functions. Thanks!

  def finddiscount (discount): if quantity & gt; = 1 more volume & lt; = 9: discount = "0%" elif volume & gt; = 10 more quantity & lt; = 1 9: discount = "20%" alip volume> = 20 and volume and lt; = 49: Discount = "30%" Alif Volume> = 50 and Quantity & lt; = 99: discount = "40%" alif volume> = 100: discount = "50%" print (discount) def main (): volume = int (input ("how many packages have been purchased?")) = Value float Input ("How much is each item?") Finddiscount) Return def findiscount (quantity): If the volume> = 1 more volume & lt; = 9: discount = "0%" elif volume & gt; = 10 more quantity & lt; = 19: discount = "20%" elif volume & gt; = 20 more quantity & lt; = 49: discount = "30%" elif volume & gt; = 50 more quantity & lt; = 99: discount = "40%" alip volume & gt; = 100: discount = "50%" print (discount) main ()  

If the statement (and can escape the cache of unexpected errors - what is the quantity = 0? Or 110?) Is like this:

import import sys inp = raw_input if sys.hexversion & lt; 0x3000000 and other input DP type-to-tarter (type_): def DMF (prompt): while correct: try: return type_ (inp (prompt)) except valueError: pass return getfn get_int = type_getter (int) get_float = type_getter (Float) discount_points = [0, 10, 20, 50, 100] discount_action = [.0, .0, .2, .3, .4, .5] DEF discount_freation (qty): ndx = bisect.bisect_right ( Discount_points, quality) return discount_frecations [ndx] def main (): qty = get_int ("how many were bought?") Value = get_float ("how many are each?") Frac = discount_fractio N (qty) total = value * (1. - frac) * qty print ("final cost is $ {: 0.2f}." Format (total)) if __name__ == "__ main__": main ()

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 -