In a Python script I'm writing, I have a function that can only output its results in a nested tuple, like so:
(('foo',), ('bar',), ('baz',), ('spam',), ('eggs',))
I need to structure a FOR loop so that I can use the tuple (as a tuple for immutability, not individual strings) like so:
('foo', 'bar', 'baz', 'spam', 'eggs')
I'm new to coding (let alone Python), and I've never had a special proclivity for loops anyway, but I'm pretty sure that I'll need to use enumerate() to pull out the 0th entries from each nested tuple, and put those in a new(?) tuple. This is the code I have...
for count,item in enumerate(tuple):
s = item[0]
item = tuple[count]
Any help or suggestion would be appreciated!