[問題] ._name_無法使用

看板Python作者 (UMAKA)時間7年前 (2016/07/29 12:46), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
想請問各位高手一下 最近剛開始學python 照著書上的範例照打結果竟然錯誤... >>> def amazing(): print('this function is named :', amazing._name_) 執行結果應該是: >>>amazing() >>>this function is named : amazing 但我執行的時候程式會一直顯示._name_這地方是錯誤的!? 想請教到底是出了什麼問題....?? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.158.111.9 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1469767566.A.9E3.html

07/29 12:56, , 1F
amazing.__name__
07/29 12:56, 1F

07/29 13:11, , 2F
喔喔~原來是兩個底線!! 感謝!!!
07/29 13:11, 2F
文章代碼(AID): #1Ncj-EdZ (Python)