TypeError:"float"对象不可调用 [英] TypeError: 'float' object not callable

查看:89
本文介绍了TypeError:"float"对象不可调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么以下代码会生成 TypeError:'float'对象不可调用?

Why does the following generate the TypeError: 'float' object not callable?

sum([-450.0,950.0])

推荐答案

似乎您正巧在与上述调用相同的作用域中分配了一个名为 sum 的变量,从而隐藏了内置的 sum 函数.

It looks like you happen to assign to a variable named sum in the same scope as the call above, thereby hiding the builtin sum function.

这篇关于TypeError:"float"对象不可调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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