Remove .md and image files and move python files into main chapter folders
This commit is contained in:
parent
5978779a9a
commit
67806dab6a
159 changed files with 0 additions and 4562 deletions
25
thinkcspy/Chapter-6-Exercises/problem3.py
Normal file
25
thinkcspy/Chapter-6-Exercises/problem3.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 6
|
||||
# Problem 3
|
||||
|
||||
import turtle
|
||||
|
||||
def drawPolygon(t, sideLength, numSides):
|
||||
"""Make turtle t draw a polygon."""
|
||||
angle = 360/numSides
|
||||
|
||||
for i in range(numSides):
|
||||
t.forward(sideLength)
|
||||
t.left(angle)
|
||||
|
||||
|
||||
wn = turtle.Screen()
|
||||
wn.bgcolor("lightgreen")
|
||||
|
||||
tess = turtle.Turtle()
|
||||
tess.color("pink")
|
||||
tess.pensize(2)
|
||||
|
||||
drawPolygon(tess,50,8)
|
||||
|
||||
wn.exitonclick()
|
||||
Loading…
Reference in a new issue