OneCompiler

How to do the .remove() function list in Python 3

178

"How to do .remvove() function" Well, look at the code below. And remember, you can only remove one value from the list.
If your value is a string, you must remove it in the Apostrophes ('). If your value is a number, do it without Apostrophes.

Code:

Mylist = [3, 9, "hello world!", 59.23]
Mylist.remove("hello world!")
print(Mylist)

This removes the "hello world!" string. If you wanna test it by your own, copy the code above. ☝