saving . . . saved List has been deleted. List has been hidden .
List
Title
Question
What is the difference between del and remove command in a list?

Python Getting-started-with-lists 11-12 min 0-10 sec 22-06-19, 11:56 a.m. NiharikaTitli

Answers:

<ul class="i8Z77e" style="margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; border: 0px; font-family: arial, sans-serif; font-size: 16px;"><li class="TrT0Xe" style="margin: 0px 0px 4px; padding: 0px; border: 0px; list-style-type: disc;">remove method: takes a value as input, searches for it, removes the first match. If the item is not found it errors out.</li><li class="TrT0Xe" style="margin: 0px 0px 4px; padding: 0px; border: 0px; list-style-type: disc;">del function: removes an item at a specific index, can delete all elements or a slice.</li></ul>
22-06-19, 12:05 p.m. PriyaBhatnagar


del command takes a index or a range of index as an argument meaning it is meant to be used to remove a range of values corresponding to the indices from a list.

remove on the other hand removes the first occurrence of the values that you specify.
22-06-19, 12:07 p.m. ankitrj.iitb


Log-in to answer to this question.