My current code:
def write_from_dict(users_folder):
for key, value in value_dict.items(): # iterate over the dict
file_path = os.path.join(users_folder, key + '.txt')
with open(file_path, 'w') as f: # open the file for writing
for line in value: # iterate over the lists
f.write('{}\n'.format(line))
My current output:
['4802', '156', '4770', '141']
['4895', '157', '4810', '141']
['4923', '156', '4903', '145']
My desired output:
4802,156,4770,141
4895,157,4810,141
4923,156,4903,145
so basically i want the spaces '' and [] removed.