“Ajouter dans une list python” Code-Antworten

Addingner List Python

>>> list = [1,2,3,4]
>>> tot = 0
>>> for i in list:
...     tot = tot + i
... 
>>> tot
10
Arrogant Ape

Addingner List 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
Arrogant Ape

Ajouter dans une list python


>>> a.add(('f', 'g'))
>>> print a
set(['a', 'c', 'b', 'e', 'd', ('f', 'g')])

Splendid Sheep

Ajouter dans une list python

ArrayList<int> L=new ArrayList<int>();
L.add(3);
Yellowed Yak

Ähnliche Antworten wie “Ajouter dans une list python”

Fragen ähnlich wie “Ajouter dans une list python”

Weitere verwandte Antworten zu “Ajouter dans une list python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen