建议ex11-14连起来学习,主要讲input
知识点:input()的用法
input的括号里可以加入提示语告诉人们要输入什么,然后赋值给变量。如:
y = input(“Name?”)
这样,我们上一个练习就可以用input重新改写
age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weight? ")
print(f"So, you're {age} old, {height} tall and {weight} heavy.")
What you should see
How old are you? 38
How tall are you? 6'22"
How much do you weight? 180lbs
So, you're 38 old, 6'22" tall and 180lbs heavy.
Study Drills
1、windows下在命令行提示符里,输入 python -m pydoc input
2、输入q 来退出pydoc
3、上网查查 pydoc是啥
4、用pydoc 查查 open, file, os 和sys。 不懂没关系。。随便看记下感兴趣的东西
也可以在python idle 里输入help(input)来获取帮助文档