请问我这个出发时间、到达时间和历时无法跟下面的对齐?
lkhight 发表于2020-03-04 20:55
得看一下你的代码是如何控制输出格式的
lieche=["车次","出发站—到达站","出发时间","到达时间","历时",
"T40","长春—北京","00:12","12:20","12:08",
"T298","长春—北京","00:06","10:50","10:44",
"Z158","长春—北京","12:48","21:06","08:18",
"Z62","长春—北京","21:58","06:08","08:20"]
for index,s in enumerate(lieche):
if (index+1) % 5 == 0:
print(s)
else:
print(s , "\t\t" , end=' ')
请大神指教
黎小贤 发表于2020-03-04 21:01
lieche=["车次","出发站—到达站","出发时间","到达时间","历时",
"T40","长春—北京","00:12","12:20","12:08",
"T298","长春—北京","00:06","10:50","10:44",
"Z158","长春—北京","12:48","21:06","08:18",
"Z62","长春—北京","21:58","06:08","08:20"]
for index,s in enumerate(lieche):
if (index+1) % 5 == 0:
print(s)
else:
print(s , "\t\t" , end=' ')
请大神指教