📜  从具有限制的列表中选择数字 python 代码示例

📅  最后修改于: 2022-03-11 14:46:07.602000             🧑  作者: Mango

代码示例1
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] #You can put the list you want
b = []
limit = int(input("Max number selected: "))
for n in a:
    if n < limit:
        b.append(n)
    else:
        pass
print(a, b)