如何在两列并排打印输出。我把它设置为打印两列,但我的数据没有对齐。顺便说一句,我不允许使用列表、元组、集合或字典。尤其不能使用string split()方法,因为它返回一个列表。在my_file=open("project05.data.txt", "r")

outfile = open("dummy.txt","w")
header = my_file.readline()
print("{:^80}".format(header[67:72]),file=outfile)
state = my_file.readline()
print(state[0:17],file=outfile)
count=0
for line in my_file:
count+=1
print(line[0:17],file=outfile)
data="{:^80}".format(line[67:75].rstrip())
print(data,file=outfile)
if count > 10:
break
outfile.close()
Output:
1+MMR
U.S. National
Alabama
89.7+5.8
Alaska
90.5+3.6
Arizona
91.4+3.7
Arkansas
88.3+5.9
California
90.7+5.3
Colorado
86.0+5.5
Connecticut
91.4+5.4
Delaware
94.8+3.4
Dist. of Columbia
96.2+3.1
Florida
93.4+4.0
Georgia
93.9+4.1