Python “int object is not callable”

前端 未结 3 1658
南旧
南旧 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:31

    You should define p first simple(int p,int r,int t) then total=p*(1+decim

    0 讨论(0)
  • 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))
    
    0 讨论(0)
  • 2021-01-28 05:46

    Here p is an integer that you try to call :

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

    I think that you want :

    total = p*(1 + (decimal * n))
    
    0 讨论(0)
提交回复
热议问题