a_list = ["abc", "def", "ghi"] f = open("a_file.txt", "w") for item in a_list: f.write(item + " ") f.close()