Python输入输出

输出

print() 用来把结果显示出来。

print("hello")

输入

input() 用来接收用户输入。

name = input("请输入名字:")

input() 返回的是字符串,如果要数字,需要用 int()float() 转换。

相关:Python程序结构Python数据类型与容器