import matplotlib.pyplot as py
x_list=[];x_list2=[]
y_list=[];y_list2=[]
def eclipse(a,b,r):
i=0
while i<(a*r)**0.5:
i+=0.01
x_list.append(i);x_list2.append(-i)
y_list.append((b*(r-(i**2)/a))**0.5);y_list2.append(0-(b*(r-(i**2)/a))**0.5)
py.xlim(-r,r)
py.ylim(-r,r)
py.plot(x_list,y_list)
py.plot(x_list,y_list2)
py.plot(x_list2,y_list2)
py.plot(x_list2,y_list)
py.show()
[@tacaswell edited to add markup]