typeerror在python和fusion360中不支持^:“float”和“float”的操作数类型

2024-09-30 22:13:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用pythonforfusion360中的for next循环,以mm为单位计算出一个距离。在

计算出一个错误:

typeerror unsupported operand type(s) for ^: 'float' and 'float'

计算如下:

distance = scale - (scale / 2^ (x/12))

我认为这与转换成int数有关(尽管我认为它必须能够处理以毫米为单位的2位小数)。 我试过了

^{pr2}$

以及

distance = int(scale - (float(scale / 2^ (x/12)) )

但都给了我可怕的打字错误。。。。在

谁能给我指出正确的方向?在


Tags: 距离for错误单位floatnextintdistance