I’m trying to remove an item from a list; but the item I’m trying to remove is located just before an
index(' '). How can I pop() the item from this list?
I’m trying to remove an item from a list; but the item I’m trying
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can give
popan index as its argument:Of course you have to make sure that the item
' 'has an index >= 1 before. If you don’t need the removed value, you can usedel lst[index]instead.