Typeerror float不可调用。我试图找出为什么我的ELIF语句不可调用 [英] Typeerror float is not callable. Im trying to figure out why my elif statement are not callable

查看:127
本文介绍了Typeerror float不可调用。我试图找出为什么我的ELIF语句不可调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

from cisc106_32 import*

def BillAmount(mb):


    if mb <= 50:
        price=50

    elif 50<mb<=400:
        price=(66.50+(.05)(mb-50.00))

    elif 400<mb<=1000:
        price=(72.00+(.08)(mb-50.00))

    else:
        price=100.00

    return price

assertEqual(BillAmount(45),50)

assertEqual(BillAmount(400),84)

assertEqual(BillAmount(2000),100)


推荐答案

在大多数编程语言中,数字,你需要一个 * 。例如:

In most programming languages, when multiplying numbers, you need a *. e.g.:

result = (0.5) * (mb - 50.00)

(不像数学中写 result =(0.5)(y)(500))和乘法暗示。)

(unlike in math when you write result=(0.5)(y)(500) and the multiplication is implied.)

这篇关于Typeerror float不可调用。我试图找出为什么我的ELIF语句不可调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆