suppose i get list of tuple as
s = [(2,),(3,)]
now i want to change the value of tuple to
[2,3]
how i can do that
s = [(2,),(3,)]
now i want to change the value of tuple to
[2,3]
how i can do that
tupList = [(2,),(3,)]
resultList = []
for tup in tupList:
resultList.append(tup[0])
print resultList
import re
>>> map(int,re.findall("(\d+)",str(s)))
[2, 3]
Comment