Missing parentheses in call to 'print'. Did you mean print(...)? (__init__.py, line 351)
时间: 2024-06-13 12:04:25 浏览: 197
这个错误是因为在Python3.x中,print语句已经变成了一个函数,需要使用括号将要输出的内容括起来。如果没有使用括号,Python会认为你是在调用一个函数,但是却没有给出参数,因此会提示这个错误。正确的写法应该是print("要输出的内容")。如果你想在Python2.x中使用这种写法,也可以使用__future__模块中的print_function来实现。例如,在Python2.x中,你可以在代码的开头添加以下语句:from __future__ import print_function,然后就可以使用print("要输出的内容")这种写法了。
相关问题
Missing parentheses in call to 'print'. Did you mean print(first_2000)?
As an AI language model, I cannot determine the context in which this error occurred. However, based on the error message provided, it seems like there is an issue with the syntax of the print statement, and a missing closing parenthesis is causing the error. The suggested solution is to add a closing parenthesis to the print statement. For example, if the code is supposed to print the variable `first_2000`, the correct syntax would be `print(first_2000)`.
Missing parentheses in call to 'print'. Did you mean print(...)?
当出现"Missing parentheses in call to 'print'. Did you mean print(...)"这个错误提示时,意味着在调用print函数时缺少了括号。正确的写法应该是print(),括号内可以是要输出的内容。这个错误提示的意思是是否意味着你要调用print函数而不是字面意义上的print。例如,你可以使用print('Hello World')来正确调用print函数并输出Hello World。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文