Q:

How to write a list containing some tuples to a text file in Python

I have a list containing some tuples as well as normal strings like below :       
a = ['sore', ('PHENOMENA', 'sore'), 'throat', ('ANATOMY', 'throat'), 'and',   'leg', ('ANATOMY', 'leg')]

I want to write it in a space separated text file in a format like:
sore ('PHENOMENA', 'sore') throat ('ANATOMY', 'throat') and leg ('ANATOMY', 'leg')

A:

Something like this?
>>> ' '.join(map(str, a))
"sore ('PHENOMENA', 'sore') throat ('ANATOMY', 'throat') and leg ('ANATOMY', 'leg')"

map(str, a) convert all elements in a to string object, then ' '.join() join them by space and returns a string object.
You can also use a list comprehension instead of map():
>>> ' '.join(str(i) for i in a)
"sore ('PHENOMENA', 'sore') throat ('ANATOMY', 'throat') and leg ('ANATOMY', 'leg')"

