首页 > 解决方案 > 将方程转换为 Python 语言

问题描述

如何将此方程式转换为 Python 代码

在此处输入图像描述

标签: python

解决方案


You can need to learn about operator precedence and associativity in Programming Languages. That way you can strengthen your understanding of how to perform complex calculations in Python. 

Apart from that try to break the problem into smaller subproblems and combine the smaller subproblems to generate solution for the larger problem.

[0.38C(1-g/C)2] = (0.38 * C) * (1 - (g/C) * 2)  
[1-(g/C)(X)]    = (1 - (g/C) * X)  
173X2           = 173 * 2  
[(X-1)+[(X-1)2 + (16X/C)]1/2] = ((X-1)+((X-1)*2 + (16*X/C))* 1/2)


Now put all values in the equation:  
"d=[0.38C(1-g/C)2]/[1-(g/C)(X)]+173X2[(X-1)+[(X-1)2 + (16X/C)]1/2]"   


    d = (((0.38 * C)*(1 - (g/c)) * 2 ) / (1 - (g/C) * X)) + 172 * 2 *((X-1) +((X-1)+((X-1)*2 + (16*X/C))* 1/2)

推荐阅读