delete values from a list in python

preview_player
Показать описание
In this video you will learn that how you can delete values from a list in python.
• remove(): It removes a given value if it is present in the list. If such a value is given that is not in the list then ValueError is raised.
• pop(): The pop() method removes the element from the specified index or the last item if index is not specified. If such an index is given which does not exist then it generates IndexError.
• clear(): It removes all the elements from the list.
• del : The del keyword can be used to delete a particular element using index or complete list can be deleted.
Syntax: del list_object[index] or del list_object
#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_28 #delete_data_from_list #python_tutorial
Рекомендации по теме
visit shbcf.ru