Q.Fill in the blank : ___________ is not a valid built-in function for list manipulations.
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Python lists have methods like count(), append(), and extend(), but not length() — to find a list's length you use the built-in function len(), not a method called length(). The answer is (b).
Python lists come with a suite of built-in methods that let you manipulate them directly. The key is knowing which operations are methods (called on the list itself, like my_list.append(x)) versus which are standalone functions (like len(my_list)).
Let's examine each option:
-
count()— This is a valid list method. It returns the number of times a specified element appears in the list. For example,[1, 2, 2, 3].count(2)returns2. -
length()— This does not exist as a list method in Python. Many students coming from other languages (like JavaScript'sarray.lengthproperty) expect this, but Python uses the built-in functionlen(my_list)instead. There is nomy_list.length()method. -
append()— A fundamental list method that adds a single element to the end of the list.my_list.append(5)modifies the list in place. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.