返回所有參數(shù)的乘積?
defmulti(c):multi1=1N=len(c)foriinrange(N):multi1=multi1*c[i]returnmulti1N=input("請(qǐng)輸入數(shù)字:")c=[input()foriinrange(N)]print(multi(c))這是我自己寫的代碼,有bug,不知道怎... def multi(c):
multi1 = 1
N = len(c)
for i in range(N):
multi1 =multi1*c[i]
return multi1
N = input("請(qǐng)輸入數(shù)字:" )
c=[input()for i in range(N)]
print(multi(c))