fork download
  1. p = [4,9,10,4,20,13,29,3,39]
  2. def get(i):
  3. print("get called i =", i)
  4. return p[i:]
  5. out = next((get(i) for i, item in enumerate(p) if item > 18), [])
  6. print(out)
Success #stdin #stdout 0.02s 9260KB
stdin
Standard input is empty
stdout
get called i = 4
[20, 13, 29, 3, 39]