Python 新手程序打印“Hello world!”

由网友 大卫 发布 阅读 5

Python 新手程序打印“Hello world!”

一个显示“ Hello,World!”的简单程序。它通常用于说明语言的语法。

源代码

# 这个程序打印 Hello, world!

print('Hello, world!')

输出结果

Hello, world!

在此程序中,我们使用了内置print()函数Hello, world!在屏幕上打印字符串。

顺便说一句,  字符串是字符序列。在Python中,字符串用单引号,双引号或三引号括起来。

Python 程序检查质数 Python 程序生成随机数