1. 程式人生 > >Missing parentheses in call to ‘print&’raw_input’ is not defined

Missing parentheses in call to ‘print&’raw_input’ is not defined

括號 int nth 基於 article 3.6 parent 新版本 pytho

對於 出現Missing parentheses in call to ‘print’和’raw_input’ is not defined問題的解決

在學習Python的過程中,我安裝的是最新版本3.6

以前因為感興趣對Python對Python的學習是基於2.0版本的,這次換成3.0版本的,出現了出現Missing parentheses in call to ‘print’和’raw_input’ is not defined問題

print‘hello world’
出現錯誤SyntaxError: Missing parentheses in call to ‘print’
後改成print(‘hello world’)可正確輸出

原來python從3.0後將print變為一個函數,所以需要加上括號,從那時開始,我就發覺,python學習過程中,肯定還會有好多版本問題,今天又遇到一個

NameError: name ‘raw_input’ is not defined

後來發現,3.0以後把raw_input變成了input,一步一步來,總有搞定的一刻,期待!


作者:Abrid_yd
來源:CSDN
原文:https://blog.csdn.net/huyr_123/article/details/77005954

Missing parentheses in call to ‘print&’raw_input’ is not defined