练习12 源代码
age = input("How old are you?") #在input中输入提示语,并赋值给age变量
height = input("How tall are you?")
weight = input("How much do you weigh?")
print(f"So, you're {age} old, {height} tall and {weight} heavy.")
输出结果
How old are you?
38
How tall are you?
6'2"
How much do you weigh?
180lbs
So, you're 38 old, 6'2" tall and 180lbs heavy.
知识点:
- input()函数中可以输入字符串,提示别人输入内容。
附加练习
1.什么是 pydoc ?
pydoc是python自带模块,一个文档生成工具,使用pydoc可以很方便的查看类和方法结构。
常见问题
- 无