python 显示invalid syntax
```import time
start_time = time.time()
x = open('assignment_1.5_Q1_input.txt', 'r')
n = int(x.read())
x.close()
ar = ""
num = 0
for i in range(1,n+1):
ar += str(i)
num += int(ar)
fp=open('assignment_1.5_Q1_output.txt','w')
fp.write(str(num)
fp.close()
end_time = time.time()
print(end_time - start_time)
也没有空格啥的呀 为啥呀
回答
fp.write(str(num))
这里少了最后一个括号。
问题解决的话,请点下采纳
以上是 python 显示invalid syntax 的全部内容, 来源链接: utcz.com/a/44930.html