[Solved] How to iterate odd indexes and add them back to original list


you can use something like that:

sentence = input().split()
ans = []
for i in range(len(sentence)):
  if i%2:
     ans.append(sentence[i]+'...')
  else:
     ans.append(sentence[i])
print(' '.join(ans))

solved How to iterate odd indexes and add them back to original list