Python-TypeError:“ int”对象不可调用

发布于 2021-02-02 23:14:59

给定以下整数和计算

from __future__ import division

a = 23
b = 45
c = 16

round((a/b)*0.9*c)

结果是:

TypeError: 'int' object is not callable.

如何将输出舍入为整数?

关注者
0
被浏览
87
1 个回答
  • 面试哥
    面试哥 2021-02-02
    为面试而生,有面试问题,就找面试哥。

    给定以下整数和计算

    from __future__ import division
    
    a = 23
    b = 45
    c = 16
    
    round((a/b)*0.9*c)
    

    结果是:

    TypeError: 'int' object is not callable.
    

    如何将输出舍入为整数?



知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看