Question : how do i add the integers in a list with itsself in python
Answered by : delightful-deer-t4eoeeosr7cu
x = [2, 4, 7, 12, 3]
sum_of_all_numbers= sum(x)
or
x = [2, 4, 7, 12, 3]
sum_of_all_numbers= reduce(lambda q,p: p+q, x)
Source : | Last Update : Sun, 17 Jan 21