how to write to the file with array values in python?,q.write(''.join(w))