I have this working for loop, I want to use lambda that prints same results below
ids= [1,2,3,4,5,6,7]
val = [20,30,26,38,40,22,35]
list1=[]
for i,num in enumerate(val):
if num > 29:
list1.append(ids[i])
print("ids",list1)
#output ids [2, 4, 5, 7]
The code below throws and invalid syntax. I just want to get the element value not the index.
new_id=list(filter(lambda ids[i]:
val[i]>29, range(len(val))))