Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove element from list python by value

prime_numbers = [2, 3, 5, 7, 9, 11, 13]

# remove 9 from the list
prime_numbers.remove(3)


# Updated prime_numbers List
print('Updated List: ', prime_numbers)

# Output: Updated List:  [2, 3, 5, 7, 9, 11, 13]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #element #list #python
ADD COMMENT
Topic
Name
2+5 =