Created
November 14, 2018 21:43
-
-
Save mikelane/560dcb85aba54d3ed6135ce7659f55b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draw_square(side_length: int) -> None: | |
for _ in range(4): | |
turtle.forward(side_length) | |
turtle.right(90) | |
def draw_concentric_squares(number_of_squares: int = 5, radius_increase: int = 20) -> None: | |
turtle.begin_fill() | |
for length in range(radius_increase, 2 * number_of_squares * radius_increase, radius_increase * 2): | |
draw_square(length) | |
x, y = turtle.pos() | |
turtle.penup() | |
turtle.setpos(x - radius_increase, y + radius_increase) | |
turtle.pendown() | |
turtle.done() | |
draw_concentric_squares(number_of_squares=10, radius_increase = 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment