Answers for "Filtrer les nombres d'une liste"

0

Filtrer les nombres d'une liste

>>> a = [1,4,2,7,1,9,0,3,4,6,6,6,8,3]
>>> b = []
>>> for x in a:
...     if x > 5:
...         b.append(x)
... 
>>> b
[7, 9, 6, 6, 6, 8]
Posted by: Guest on July-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language