playground/python/turtle-eg.py

28 lines
444 B
Python

from turtle import *
# https://www.youtube.com/watch?v=MO_euV5YwVc
def polygon(n, sidelen):
for i in range(n):
forward(sidelen)
right(360/n)
# Set pen-colour to red and fill-colour to yellow
color('red', 'yellow')
t = Turtle()
# t.speed("fastest")
# t.hideturtle()
polygon(6, 100)
input()
# begin_fill()
# while True:
# forward(200)
# left(170)
# if abs(pos()) < 1:
# break
# end_fill()
# done()