Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Fun & learn with python turtle

# Draw something that i don't care about

import turtle as tu


sc =tu.Screen()
sc.bgcolor("black")

t = tu.Turtle()
t.speed(60)

t.pensize(3)

for i in range(100):
      t.circle(5 + 2 * i , 44)
      if t.pos()[1] >= t.pos()[0]:
            t.pencolor("yellow")
            t.dot(12)
      elif t.pos()[1] <= t.pos()[0]:
            t.pencolor("blue")
            t.dot(12)

t.hideturtle()
            
sc.exitonclick()



Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Fun #learn #python #turtle
ADD COMMENT
Topic
Name
6+3 =