在python中计算project1租车草案中的基本费用

2024-09-29 21:54:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图输出300.00作为我在python中的租车项目的基本费用,但使用的是codio。300.0是我收到的以下代码的结果,我遗漏了什么??在

baseCharge = 0
if rentalCode == "B":[enter image description here][1]
    baseCharge = (rentalPeriod) * (budgetCharge)
elif rentalCode == "D":
    baseCharge = float(rentalPeriod) * float(dailyCharge)
elif rentalCode == "W":
    baseCharge = float(rentalPeriod) * float(weeklyCharge)    
print(baseCharge)

最后一次运行时间:2019年1月28日上午9:37:55 检查1失败 输出: (B) udget,(每天)还是(W)每周出租? 租赁天数: D 5 300 预期: (B) udget,(每天)还是(W)每周出租? 租赁天数: D 5 300.00美元


Tags: 项目代码iffloat费用enterelif天数

热门问题