《笨办法学Python3》练习十一:问一些问题
2019-03-01 本文已影响0人
雨开Ame
练习代码
print("How old are you?", end = ' ')
age = input()
print("Hoe=w tall are you?", end = ' ')
height = input()
print("How much do you weigh?", end = ' ')
weight = input()
print(f"So, you're {age} old, {height} tall and {weight} heavy.")
Study Drills
-
Go online and find out what Python’s input does.
-
Can you find other ways to use it? Try some of the samples you find.
-
Write another “form” like this to ask some other questions
补充
- 通过
input()
获得的是string
类型的数据,如果想获得一个整数,需要用int()
转换。