I am trying to implement next(i for i,v in enumerate(l) if 12 in v) like in this post, but when I replace 12 with variable myvar, it throws error NameError: name 'myvar' is not defined. The code is:
myvar=12
next(i for i,v in enumerate(l) if myvar in v)
EDIT:
I am using Eclipse+PyDev, it throws error, see img.

How to solve this? Thank you.