Missing parentheses in call to 'print'
时间: 2024-04-25 16:21:58 浏览: 62
回答: 报错"Missing parentheses in call to 'print'"是由于Python3和Python2版本的差异导致的。在Python3中,print函数需要加上括号,例如print('a = ', a)。而在Python2中,可以直接使用print语句,例如print "------软件测试自动化:登录界面测试用例------"。所以解决这个问题有两种方法,一种是将代码改为Python3的语法,即加上括号,另一种是将代码运行在Python2环境中。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* *2* [SyntaxError: Missing parentheses in call to ‘print‘. 正解](https://blog.csdn.net/weixin_45653050/article/details/107306665)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [python报错系列(9)--SyntaxError: Missing parentheses in call to ‘print‘. Did you mean print()](https://blog.csdn.net/qq_45365214/article/details/122712737)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文