Exercise 7: Delete an Element
Write code to delete an element from the array.
We'll cover the following...
We'll cover the following...
Problem statement
Delete one element from the given array to match this modification:
Before deletion:
input_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
element = 6
After deletion:
input_array = [1, 2, 3, 4, 5, 7, 8, 9, 10]
Note: Explore the documentation and use the appropriate method to delete the element from the array.
Try it yourself
Press + to interact
def delete_element(input_array,element)# Start your code herereturn input_arrayend