Initial commit: Python learning project with examples and exercises
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#e2.3DrawPython.py
|
||||
from turtle import*
|
||||
def drawSnake(radius, angle, length):
|
||||
seth(-40)
|
||||
for i in range(length):
|
||||
circle(radius, angle)
|
||||
circle(-radius, angle)
|
||||
circle(radius, angle/2)
|
||||
fd(20)
|
||||
circle(16, 380)
|
||||
fd(40* 2/3)
|
||||
|
||||
setup(1000, 350, 200, 200)
|
||||
penup()
|
||||
fd(-250)
|
||||
pendown()
|
||||
pensize(25)
|
||||
pencolor("purple")
|
||||
drawSnake(40, 80, 4)
|
||||
seth(0)
|
||||
pencolor("blue")
|
||||
drawSnake(40, 80, 4)
|
||||
done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user