fork download
  1. x = ['foo', 'bar']
  2. for index, y in enumerate(x):
  3. if y == 'bar':
  4. x[index] = 'qwerty'
  5.  
  6. print(x)
Success #stdin #stdout 0.02s 9156KB
stdin
Standard input is empty
stdout
['foo', 'qwerty']