fork download
  1. a = [1, 2, 2, 3, 4, 5, 5]
  2. for i in range(1, len (a), 2):
  3. print(i, a[i] == a[i-1], a[i] == a[i+1])
Success #stdin #stdout 0.03s 9440KB
stdin
Standard input is empty
stdout
1 False True
3 False False
5 False True