मराठी

What does the list.remove(x) method do in Python? - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

What does the list.remove(x) method do in Python?

पर्याय

  • Removes the element at index x from the list.

  • Removes the first occurrence of value x from the list.

  • Removes all occurrences of value x from the list.

  • Removes the last occurrence of value x from the list.

MCQ

उत्तर

Removes the first occurrence of value x from the list.

Explanation:

list.remove(x) finds the first occurrence of the value x in the list. If it discovers x, it removes it. If the value x does not appear in the list, it throws a ValueError. 

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×