Computer Science · Python Lists
If a programmer has a Python list object numbers = [10, 20, 30] and executes the statement numbers.append(40), what happens to the list?
- 1The integer 40 is added to the end of the list as a single element✓
- 2A TypeError occurs because append() only accepts list objects
- 3The integer 40 is wrapped in a list and added as a nested element
- 4The integer 40 replaces the last item of the list
Correct answer
The integer 40 is added to the end of the list as a single element
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Python Lists?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Python Lists