हिंदी

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×