Skip to main content

setAt

Sets a list item at index.

setAt(targetList, index, item)

Parameters#

  • targetList: list where item will be set
  • index: An index within the targetList
  • item: A value of supported type

Returns#

  • No value

Example#

fruits = ['apple', 'banana', 'orange']setAt(fruits, 1, 'peach')print(fruits[1]) # prints, peach