Robotics & Artificial Intelligence
Give the output of the following Python code.
my_list = [1, 2, 3, 4]
my_list.append(5)
my_list.insert(2, 10)
print(my_list)
- [1, 2, 3, 4, 5, 10]
- [1, 10, 2, 3, 4, 5]
- [1, 2, 10, 3, 4, 5]
- [1, 2, 3, 10, 4, 5]
Python List Manipulation
1 Like
Answer
[1, 2, 10, 3, 4, 5]
Reason — First, append(5) adds 5 at the end of the list, so the list becomes [1, 2, 3, 4, 5]. Then, insert(2, 10) inserts 10 at index position 2, shifting the existing elements to the right. Hence, the final list printed is [1, 2, 10, 3, 4, 5].
Answered By
2 Likes
Related Questions
Identify the type of graph shown below.

- Line graph
- Pie plot
- Bar graph
- Scatter plot
Which one of the following is a single board computer?
- Raspberry Pi
- TensorFlow
- PyTorch
- Media center
What are warehouse robots and how are they used in transport industry?
Read the paragraph below and answer the question that follows.
"The helical gears are similar to spur gears but have angled teeth. This helical tooth arrangement enables smoother and quicker operation compared to spur gears. Helical gears are commonly used in applications where high torque transmission and reduced noise are essential."
Write any two key differences between helical gears and spur gears.