sympy给出如下结果:
Ellipse(Point(0,0),3,2)
Point(2.875, -0.661437827706861)
如果我要提取这些数字:0,0,3,2,2.875 ...有什么简单的方法可以得到它们?
最佳答案
>>> from sympy import Ellipse, Point
>>> e = Ellipse(Point(0, 0), 3, 2)
>>> p, maj, min_ = e.args
>>> maj
3
>>> p
Point(0, 0)
>>> x, y = p.args
>>> x
0