How do you insert an object at a given index in Python?

Hi, How do you insert an object at a given index in Python

Hi Jhon,

How about you tell us what YOU think the answer is, how you can
insert an object into a list, and we’ll tell you if you got it
right?

Hint: open a Python interactive interpreter, and at the >>> prompt,
enter this:

help(list)

You should be able to use the space bar to page through the list of
commands.

If you prefer, you can also read this:

https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range

You may need to scroll down to find the name of the method used to
insert items into a list. You can use your browsers “Find” command
(usually Ctrl-F) to search for likely words. If you had to guess the
name of a method used to insert what name would you guess?

1 Like