【问题标题】:Problems with print statment [closed]打印语句的问题[关闭]
【发布时间】:2019-04-22 09:15:44
【问题描述】:

我 100% 是编程新手,但在练习 print hello world 语句时遇到了麻烦。我的代码如下:

  print(hello world!)

【问题讨论】:

  • 有什么问题?
  • ' 包裹hello world!print('hello world!')
  • 声明中缺少'
  • 一点建议:阅读错误信息。它可能显示类似“无效语法”的内容。从那里,您可以搜索print 的正确语法或使用print 时“无效语法”的含义。

标签: python printing


【解决方案1】:

您缺少需要在 Python 中环绕任何字符串对象的 ''""

试试:

print('Hello World!')

您可能会发现this documentation 很有用。

【讨论】: