程序代码:


print("How old are you?", end=' ')
age = input()
print("How 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.")

输出结果:


How old are you? 35
How tall are you? 173
How much do you weigh? 80kg
So, you're 35 old, 173 tall and 80kg heavy.
end=' ' 代表不换行
最后修改:2021 年 03 月 09 日
如果觉得我的文章对你有用,请随意赞赏