This commit is contained in:
Julin S 2023-06-19 10:20:20 +05:30
commit 41eb5cf26a
1 changed files with 27 additions and 0 deletions

27
python/turtle-eg.py Normal file
View File

@ -0,0 +1,27 @@
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()