Python “int object is not callable”

前端 未结 3 1695
南旧
南旧 2021-01-28 05:18

TypeError: \'int\' object is not callable

Anyone knows how can I fix this error? I know error is somewhere in the equation in the total. Thanks

decimal =         


        
3条回答
  •  天命终不由人
    2021-01-28 05:36

    On this line p is expected to be a function because it is immediately followed by a parenthesis:

    total = p (1 + (decimal * n))
    

    But p is passed as a parameter above, so I'm guessing you are passing an integer. If you mean to multiply:

    total = p * (1 + (decimal * n))
    

提交回复
热议问题