Fill: List Insert
Fill in the Blank Easy
Question
Fill in the blank to insert 99 at index 1.
Code
nums = [1, 2, 3]
nums.___(1, 99)
Hint
The method that adds an element at a specific index is...
Explanation
insert(index, value) inserts the value at the given index, shifting existing elements right. After nums.insert(1, 99), nums is [1, 99, 2, 3].
Related Resources
Related Lessons
- Lists
List insert.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.