大家好,我是新來的python語言,我選擇了學python難學的方法來學習它,並更好地理解我......我被難倒在練習25,當我們導入代碼直接進入終端學習python的難題,練習25
>>> import ex25
>>> sentence = "All good things come to those who wait."
>>> words = ex25.break_words(sentence)
然後我得到一個屬性錯誤
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'break_words'
我使用 窗口Python 2.7版7,請幫助..... http://learnpythonthehardway.org/book/ex25.html
那麼你在'ex25.py'中定義了什麼呢? –
'進口ex25; dir(ex25)'會告訴你模塊提供了哪些功能。 –
可能是ex25中的錯字,或者您可能沒有複製/粘貼網頁中的所有源代碼。 – gatto