fonctions liste python code example
Example 1: additionner liste python
>>> list = [1,2,3,4]
>>> tot = 0
>>> for i in list:
... tot = tot + i
...
>>> tot
10
Example 2: indice d'un element dans une liste python
week = ['monday','tuesday','wednesday']
week.index('tuesday')
>>> 1
"""Warning => error if the element isn't in the list"""