a=0
b=1
c=2
d=3
e=4
Var = [a,b,c,d,e]
Var2 =[]
for i in Var:
if i <= 2:
Var2 = [i]
print(Var2)
this is the result
[2]
Process finished with exit code 0
a=0
b=1
c=2
d=3
e=4
Var = [a,b,c,d,e]
Var2 =[]
for i in Var:
if i <= 2:
Var2 = [i]
print(Var2)
this is the result
[2]
Process finished with exit code 0