>>> def prod(*args):
... I= len(args)
... s = 0
... while I >0:
... s = 1
... for n in args:
... I=I-1
... s = s * n
... print(s)
...
>>> prod()
0
>>> prod(5)
5
>>> prod(5,5)
25
>>> prod(5,5,5)
125
Sign in to make a reply
weiqing1230
>>> def prod(*args):
... I= len(args)
... s = 0
... while I >0:
... s = 1
... for n in args:
... I=I-1
... s = s * n
... print(s)
...
>>> prod()
0
>>> prod(5)
5
>>> prod(5,5)
25
>>> prod(5,5,5)
125