#Initialisation
lst = []
for i in range(5):
#ajouter à
lst.append(i)
print(lst) # [0, 1, 2, 3, 4]
#Filtre
filtered = list(filter(lambda x:x == 1, lst))
print(filtered) # [1]
#Compter
print(len(filtered)) # 1
Recommended Posts