-3

I have list as follows:

list = [u'windows 32bit', u'i7', u'5Mb', u'energenie_eu', u'nvidia_970']

I want to take out value '5Mb' out of it. So, suggest me how can i take out value '5Mb' seperated from the list and have list as :

[u'windows 32bit', u'i7', u'energenie_eu', u'nvidia_970']
0

2 Answers 2

1

You can remove elements by item

list.remove("5Mb")
Sign up to request clarification or add additional context in comments.

Comments

0

you could also do,

A = L[:n]+L[n+1:]

if you wanted a copy of the list wihout the element to work with. You could use L.index to find n if you only know the list item by value rather than position - though then you are back to L.remove and the time penalty for searching the list.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.