1. 程式人生 > 實用技巧 >Python文件字串報錯:TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given

Python文件字串報錯:TypeError: __call__() takes from 1 to 2 positional arguments but 3 were given

1.問題:在使用文件字串時,報錯:TypeError: call() takes from 1 to 2 positional arguments but 3 were given
2.原因分析:由於初步學習python,看不懂問題所在,找了半天,終於找到問題所在,誤將程式中的點寫成了逗號。help(testrr,doc)
在這裡插入圖片描述
3.解決:找到問題所在後,將語句寫正確,問題解決。
在這裡插入圖片描述
備註:僅以此帖記錄學習中的問題,便於回顧,未進行深入分析。