2019.02.16人工智能(python基础:输入和输出语句)

输出语句

格式:print()

输入语句

格式:input()

代码举例

#输出
print('hello')

#输入
print('请输入您的姓名:')
name = input()
print('我的名字是:',name)

运行结果:
在这里插入图片描述

在输入语句中添加提示:

age = input('请输入你的年龄:')
print('我的年龄是:',age)

运行结果:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_34191426/article/details/87515393