0
How to built a program for getting product of entries in a list
3 Antworten
0
For example we have a list:
x = [1,2,3,4]
res = 1 # init a first value
for i in x: # for every number in list
res *= i # product it with previous
print (str(res)) # will print 24
0
liste=[1,2,3,4,5]
result=1
for i in liste:
result*=i
print (result)
- 1
By database??? Or other