`from functools import reduce prod =lambda n:reduce(lambda x,y:x*y,n if n else[0])`

~~from~~**iter**tools import**product****def**prod**(n):****if not**n:re**turn 0****n = n[-1]****fact =**lambda x**: x**if**x <= 2**else**x*fact(x-1)****return fact(n**)- from
**func**tools import**reduce** - prod
**=lambda**n:re**duce(**lambda x**,y:x*y,n**if**n**else**[0]**)

Algorithms

Logic