我正在创建第一个将文件写入文件的脚本,但是我收到了错误。
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")
答案 0 :(得分:0)
你的最后一行缺少第二个右括号。