#Initialization
lst = []
for i in range(5):
#add to
lst.append(i)
print(lst) # [0, 1, 2, 3, 4]
#Filter
filtered = list(filter(lambda x:x == 1, lst))
print(filtered) # [1]
#Count
print(len(filtered)) # 1
Recommended Posts