Answers for "number list adder"

0

additionner liste python

>>> list = [1,2,3,4]
>>> sum(list)
10

>>> l = ['a',1,'f',3.2,4]
>>> sum([i for i in l if isinstance(i, int) or isinstance(i, float)])
8.2
Posted by: Guest on April-06-2020
1

how to add numbers into a list python

a_list = [1, 2, 3]
integers_to_append = 4.
a_list. append(integers_to_append)
print(a_list)
Posted by: Guest on January-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language