笨办法学Python 3 习题11
程序员文章站
2022-06-15 18:37:48
...
[交作业啦]
ex11.py
# 不要用换行符(\n)结束这一行
print("How old are you?", end = ' ')
age = input()
print("How tall are you?", end = ' ')
height = input()
print("How much do you weight?", end = ' ')
weight = input()
# f-string
print(f"So, you are {age} old, {height} tall and {weight} heavy.")
会话
PS E:\lpthw> python .\ex11.py
How old are you? 31
How tall are you? 158cm
How much do you weight? 45kg
So, you are 31 old, 158cm tall and 45kg heavy.
PS E:\lpthw>
[学习心得]
input()函数接收一个标准输入数据,返回为string类型。
上一篇: markdown基础语法
下一篇: JavaScript实现密码框验证信息