Advertisements
Advertisements
प्रश्न
Write a function remove_element() in Python that accepts a list L and a number n. If the number n exists in the list, it should be removed. If it does not exist, print a message saying “Element not found”.
कोड लेखन
Advertisements
उत्तर
def remove_element(L, n):
if n in L:
L.remove(n)
print(L)
else:
print("Element not found")shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
