我有一个包含制表符分隔字符串的文件...
string_one string_two
我想将该文件作为输入,并在每行末尾返回一个新的制表符分隔值,其中包含两个字符串的连接。
到目前为止我有这个
#concatenate.py
from sys import argv
scriptname, filename = argv
with open(filename) as f:
for line in f:
#take the first word
#take the second word
#concatenate them and add them to the end of line
我试过了
for word in line
获取每个单词但获取每个字符,我如何指定(标记)每个单词