-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']
anamika email
  • 327
  • 9
  • 21

2 Answers2

1

You can remove elements by item

list.remove("5Mb")
Dportology
  • 836
  • 1
  • 9
  • 32
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.