YouTip LogoYouTip

Python3 Att List Remove

# Python3.x Python3 List remove() Method [![Image 3: Python3 Lists](#) Python3 Lists](#) * * * ## Description The `remove()` function is used to remove the first occurrence of a specified value from a list. ## Syntax The syntax for the `remove()` method is: list.remove(obj) ## Parameters * obj -- The object to be removed from the list. ## Return Value This method does not return any value but removes the first occurrence of the specified value from the list. ## Example The following example demonstrates the usage of the `remove()` function: ## Example #!/usr/bin/python3 list1 =['Google','','Taobao','Baidu'] list1.remove('Taobao') print("List now is : ", list1) list1.remove('Baidu') print("List now is : ", list1) The output of the above example is as follows: List now is : ['Google', '', 'Baidu']List now is : ['Google', ''] [![Image 4: Python3 Lists](#) Python3 Lists](#)
← Java Arraylist SublistJava Arraylist Size β†’