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
32
thinkcspy/Chapter-6-Exercises/problem4.py
Normal file
32
thinkcspy/Chapter-6-Exercises/problem4.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 6
|
||||
# Problem 4
|
||||
|
||||
import turtle
|
||||
|
||||
def drawSquare(t, sz):
|
||||
"""Get turtle t to draw a square of sz side"""
|
||||
|
||||
for i in range(4):
|
||||
t.forward(sz)
|
||||
t.left(90)
|
||||
|
||||
wn = turtle.Screen()
|
||||
wn.bgcolor("lightgreen")
|
||||
|
||||
alex = turtle.Turtle()
|
||||
alex.color("blue")
|
||||
alex.pensize(2)
|
||||
alex.speed(10)
|
||||
|
||||
|
||||
def drawCircleSquares(tt, num):
|
||||
for i in range(num):
|
||||
drawSquare(tt, 80)
|
||||
tt.right(15)
|
||||
|
||||
|
||||
drawCircleSquares(alex, 25)
|
||||
|
||||
|
||||
wn.exitonclick()
|
||||
Loading…
Reference in a new issue