Answers for "add the elements in a list after converting int"

1

python how to put int into list

numList=[1,2,3]
num=4
numList.append(num)
Posted by: Guest on March-12-2021
0

how do i add the integers in a list with itsself in python

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)
Posted by: Guest on January-10-2021

Code answers related to "add the elements in a list after converting int"

Python Answers by Framework

Browse Popular Code Answers by Language