Python学习笔记(笨方法学Python3)-习题11:提问

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.")

#result
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.

文件保存为ex11.py

注意:
end = ’ ’ 告诉print不要使用换行符结束这一行跑到下一行去。
py2.x 中和py3.x 中input函数的比较:https://blog.csdn.net/qq_34595352/article/details/90379141

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值