fork(2) download
  1. # your code goes here
  2. a = [0.2, 0.4, 0.2, 0.1, 0.5, 0.2, 0.1, 0.1, 0.92, 0.2, 0.3, 0.4, 0.3, 0.5, 0.4, 0.2, 0.2]
  3.  
  4. result = [[a[i-1], a[i], a[i+1]] for i in range(1, len(a)-1) if a[i] >= 0.5]
  5. print(result)
Success #stdin #stdout 0.03s 27712KB
stdin
Standard input is empty
stdout
[[0.1, 0.5, 0.2], [0.1, 0.92, 0.2], [0.3, 0.5, 0.4]]