错误:解析时出现意外的EOF。试图写入文件

时间:2017-01-03 00:17:33

标签: python-3.x

我正在创建第一个将文件写入文件的脚本,但是我收到了错误。

import math

client = str()
wordcount = int()
client = str(input("Who will this be written for? "))
wordcount = int(input("How many words long would you like the story to be? "))

baseprice = 5
finalprice = int()
subfin = wordcount/600
finalprice = subfin * baseprice
print("\nClient: ",client,"\nWordcount: ",wordcount,"\nPrice: $",format(finalprice,".2f"))

f = open('clients.txt', 'w')
f.write("\nClient: ",client,"\nWordcount: ",wordcount,"\nPrice: $",format(finalprice,".2f")

1 个答案:

答案 0 :(得分:0)

你的最后一行缺少第二个右括号。