def fact( )return reduce(lambda , : *yrange( , + ) the operator module in the previous sectionwhen we needed function to represent python operator like addition or multiplicationwe used an anonymous functionlike belowtotal reduce(lambda ,yx+yrange( , )python has module called operator that contains functions that accomplish the same thing as python operators these will run faster than anonymous functions we can rewrite the above example like thisfrom operator import add total reduce(addrange( , )the operator module has functions corresponding arithmetic operatorslogical operatorsand even things like slicing and the in operator more about function arguments you may want to write function for which you don' know how many arguments will be passed to it an example is the print function where you can enter however many things you want to printeach separated by commas python allows us to declare special argument that collects several other arguments into tuple this syntax is demonstrated belowdef product(*nums)prod for in numsprod*= return prod print(product( , )product( , , )sep'\ ' there is similar notation**for collecting an arbitrary number of keyword arguments into dictionary here is simple exampledef (**keyargs)for in keyargsprint( '** 'keyargs[ ]** sep'' ( = = = **