Python TypeError: unsupported operand type(s) for ^: 'float' and 'int'

前端 未结 1 1072
夕颜
夕颜 2021-01-07 16:48

I wrote a simple program which approximates the evaluation of a definite integral using numerical integration. However, I am stumped when it comes to why I am getting the er

相关标签:
1条回答
  • 2021-01-07 17:23

    When trying to raise to a power use the operand use ** and not ^.

    f=math.sqrt(1+(6*x+4)**2)
    
    0 讨论(0)
提交回复
热议问题