What does “SyntaxError: Missing parentheses in call to 'print'” mean in Python?

前端 未结 8 1315
天命终不由人
天命终不由人 2020-11-21 09:02

When I try to use a print statement in Python, it gives me this error:

>>> print \"Hello, World!\"
  File \"\", line 1
            


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-21 09:52

    In Python 3, you can only print as:

    print("STRING")
    

    But in Python 2, the parentheses are not necessary.

提交回复
热议问题