我做了我能做的一切,但它没有打印我想要的东西,只是出来了 电子售票自动化系统 成人人数:3 儿童人数:3 长者人数:3 什么样的会员资格1个为企业会员,2个为家庭会员:1 有信息输入错误,请重新输入以上信息
进程已完成,退出代码为“0”
print("E Ticketing Automation System")
#a for adult b for kids and c for elderly
a = int(input("Numbers of adult: "))
b = int(input("Numbers of kids: "))
c = int(input("Numbers of elderly: "))
membership = input("what kind of membership 1 for corporate or 2 for
family: ")
totalprice = (a*10.00) + (b*7.50) + (c*5.50)
kiddo=b*7.50
corporate = totalprice-(totalprice/100)*20
ccorporate=(totalprice/100)*20
family = totalprice-(b*7.50)
if membership == 1:
print("The original price before discount is $,",totalprice,"after 20
percent discount",ccorporate, "the total price will be $",corporate, )
elif membership == 2:
print("The original price is $",totalprice,"but after deduction of the
kids price $",kiddo,"the total price will be $",family,)
else:
print("there is information inputted incorrectly pls re-enter the info
above.")
我猜您忘记考虑变量^ {< CD1>}的输入,如^ {< CD2>}。
这是更新后的源代码
预期产出:
相关问题 更多 >
编程相关推荐