Math limits in python?

I am trying to fulfill mathematical constraints in python.

I defined a function for smoke

import turtle
t = turtle.Pen()

def drawsmoke(y):
    i = 0
    while i < ((2 * y) - 1):
        t.seth(i * 5)
        t.circle((10 + i), 160)
        i = i + 2

it draws one side of the smoke and the other side has yet to be done.

Now there is a problem when I try to attract about 4 circles of smoke (y = 4) that the smoke starts to rotate incorrectly. To fix this, I decided to make a mathematical limit. I would make a variable

   smkang=(i*5)

and then make a restriction on this variable:

      lim
    smkang->20    

How can i do this? or is there another way that is not related to limits? By the way, this is a turtle (python language, but imported turtle) thanks

+5
source share
1 answer

sympy. SymPy - Python . (CAS), , . SymPy Python - . :

>>> from sympy import limit, Symbol, sin, oo
>>> x = Symbol("x")
>>> limit(sin(x)/x, x, 0)
1
+9

All Articles