编程语言
首页 > 编程语言> > python 解方程

python 解方程

作者:互联网

def solve(eq,var='x'):
    c = eval(eq,{var:1j})
    print(eq, c.real)
    print(-c.real/c.imag)

solve("x-x/1.06*0.0672-2838500-(x/1.06-x/1.06*0.06*0.12-2838500-3648254652.18)*0.25-5184042231.65")

solve("x-x/1.06*0.0672-(x/1.06-x/1.06*0.06*0.12-907062220.47)*0.25-1076351297.61")

solve("x-x/1.06*0.0672-(x/1.06-x/1.06*0.06*0.12-466567540.64)*0.25-932162858.41")

solve("x-x/1.06*0.0672-2838500-(x/1.06-x/1.06*0.06*0.12-2838500-2274624891.07)*0.25-3175528075.63")

  

标签:1.06,python,0.25,2838500,0.06,solve,解方程,0.0672
来源: https://www.cnblogs.com/miczh/p/12208759.html