Python编程从⼊门到实践课后习题7-4、7-5、7-6 Python编程从⼊门到实践课后习题7-4、7-5、7-6
记录练习的答案
7-4 披萨配料
question ="你想加什么配料?"二进制与十进制之间的转换表
question +="\n (Enter 'quit' 结束循环)\n"
topping =""
while topping !='quit':
topping =input(question)
if topping =='quit':
break
elif topping =='apple':
18的原码怎么算print("没有")
else:
print("给你加"+ topping +"\n")
7-5 电影票
age ="How old are you ? "
age +="\n(Enter 'quit' to stop it)\n"
price =""
while age !='quit':
price =input(age)
if price =='quit':
break
elif int(price)<=3:
print("free")
elif3<int(price)<12:
怎样制作表格在电脑上print("fee is 10")
elif int(price)>=12:
print("fee is 15")小舍得电视剧免费完整版无删减
7-6 三个出⼝
question ="你想加什么配料?"
什么软件可以无水印下载视频question +="\n (Enter 'quit' 结束循环)\n"
topping =""
学python编程入门active =True
while active:
topping =input(question)
if topping =='quit':
active =False
else:
print("给你加"+ topping +"\n")
price =""
age ="How old are you ?\n"
age +="\n(Enter 'quit' to stop it)\n" active =True
while active:
price =input(age)
if price =='quit':
active =False
elif int(price)<=3:
print("free")
elif3<int(price)<12:
print("fee is 10")
elif int(price)>=12:
print("fee is 15")
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论