l = [1,2]
You need to do:
l.remove(1)
To delete 1
from the list
del(l[1])
will delete the item at index 1
not the actual element with value 1
More Related Contents:
- How do I remove all white space in any given input? [closed]
- a python library that accepts some text, and replaces phone numbers, names, and so on with tokens
- Short description of the scoping rules?
- Handling very large numbers in Python
- Why do you need explicitly have the “self” argument in a Python method?
- How do I get monitor resolution in Python?
- Python list multiplication: [[…]]*3 makes 3 lists which mirror each other when modified [duplicate]
- Writing a connection string when password contains special characters
- ImportError: No module named PIL
- Is there a Python equivalent of the C# null-coalescing operator?
- Interactive input/output using Python
- Numpy integer nan [duplicate]
- Receive and send emails in python
- Combining two Series into a DataFrame in pandas
- Take multiple lists into dataframe
- Adding two pandas dataframes
- Using Extensions with Selenium (Python)
- How to group pandas DataFrame entries by date in a non-unique column
- What is the difference between int() and floor() in Python 3?
- pandas: combine two columns in a DataFrame
- How to set justification on Tkinter Text box
- Why using an array as an index changes the shape of a multidimensional ndarray?
- how to convert list of dict to dict
- While installing pyttsx3: Command errored out with exit status 1
- Calling Python script from C++ and using its output
- How to find a missing number from a list?
- socket.gaierror: [Errno 11001] getaddrinfo failed
- How to use QThread correctly in pyqt with moveToThread()?
- Why am I getting NotImplementedError with async and await on Windows?
- CSRF validation does not work on Django using HTTPS