I am returning several values in a function:
def count_chars(e):
return len(e), 'bar'
like this:
for d in lst:
newlst = []
for x in d["data"]:
newlst.extend([x, count_chars(x)])
d["data"] = newlst
pprint(lst)
However, when I return the values the come inside a tuple:
{'data': ['YES', (9, 'bar')], 'info': 'AKP'}
How can I get rid of the tuple? for
{'data': ['YES', 9, 'bar'], 'info': 'AKP'}
lst?