在Python中,可以使用print()
函数将内容输出到控制台。
例如:
print("Hello, World!")
这会在控制台上显示文本 “Hello, World!”。
你还可以将变量或表达式传递给print()
函数,例如:
x = 5
y = 10
print("The sum of", x, "and", y, "is", x + y)
这会在控制台上显示文本 “The sum of 5 and 10 is 15”。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: python中怎么声明全局变量