[Python] SyntaxError: Missing parentheses in call to ‘print’

因為在 Ubuntu 上目前安裝的 Python 版本還是 2.7
而之前在 Windows 安裝的版本為 3.0
導至把 Ubuntu 上寫好的 code 拿至 Windows 上編譯時會發生下列錯誤…
SyntaxError: Missing parentheses in call to ‘print’

這時候參考stackoverflow: What does “SyntaxError: Missing parentheses in call to ‘print’” mean in Python?
得知要把 print 語法修正一下

原本使用的是

要更改為

差別就是用 ( ) 包起來~

This entry was posted in Python. Bookmark the permalink.