python turtle web code example

Example 1: turtle python

from turtle import *
color('red', 'yellow')
begin_fill()
while True:
    forward(200)
    left(170)
    if abs(pos()) < 1:
        break
end_fill()
done()

Example 2: python turtle

import turtle
tina=turtle.Turtle()
#trinket.io specializes in these stuff

Example 3: turtle with python

import turtle
#creating a square with turtle
t = turtle.Turtle()
t.forward(100)
t.color('blue')
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)

Example 4: python turtle tutorial

>>> s = turtle.getscreen()