代码点读机 / Python / print

print Python · 内置函数

把内容打印到屏幕,像超市收银机吐小票:你要什么,它就一行行吐出来。

怎么用

print(内容1, 内容2, ...)

小例子

print('hello')
print('我今年', 18, '岁')

运行结果

hello
我今年 18 岁

提醒:多个内容用逗号会默认加空格。

官方文档:https://docs.python.org/zh-cn/3/library/functions.html#print

在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← Python全部词条