join用的不错
a = "Hello, world" b = "你好,世界" c = "How are you?" with open(file='a.txt', mode='w', encoding='utf-8') as f: f.write(' '.join([a, b, c])) f.write(' ' + '=' * 30)
join用的不错
a = "Hello, world" b = "你好,世界" c = "How are you?" with open(file='a.txt', mode='w', encoding='utf-8') as f: f.write(' '.join([a, b, c])) f.write(' ' + '=' * 30)