输出:
使用print()函数
print("hello word !")
print()函数也可以接受多个字符串,用逗号“,”隔开,就可以连成一串输出:
print("name","is","python")
字符打印
print("100","+","200","=",100+200)
输入:
使用input()函数
name = input()
需要回车才能结束输入
input()参数可以是字符串
name = input("please input your name: ")
这样子可以将输入保存为变量name
name = input("please input your name: ")
print("hello",name)
结果如下:
输入是Input,输出是Output,因此,我们把输入输出统称为Input/Output,或者简写为IO