码迷,mamicode.com
首页 > 编程语言 > 详细

python 解方程

时间:2020-01-18 14:19:50      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:eva   python   pytho   real   div   ima   print   def   highlight   

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")

  

python 解方程

标签:eva   python   pytho   real   div   ima   print   def   highlight   

原文地址:https://www.cnblogs.com/miczh/p/12208759.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!