2016-12-02 67 views

回答

0

你嘗試寫在文件float

prob_per1 = 1.5 
myfile = open('probability.txt','w') 
myfile.write(prob_per1) 
myfile.close() 

錯誤消息,但方法.writedoesn't take arguments in non-string format,嘗試將其與轉換寫string這樣的:

myfile.write(str (prob_per1))