程序代码:
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=' ' 代表不换行