如果你的意思是“低于”或“低于”,你可以使用 list comprehension
c = len([x for x in a if x < b])
如果您担心空间限制,可以使用 generator 就像亚历山大的回答。
sum(1 if num < b else 0 for num in a)