From 53033a7ec2b1f6bd8fd50575a1c2869f54683164 Mon Sep 17 00:00:00 2001 From: ilmabura Date: Tue, 2 Sep 2025 00:01:09 -0400 Subject: [PATCH] created for loops to create circles at each point of the initial star. i was initally just going to draw a bunch of different circles but then I wanted to see how I can create a repetitive pattern with for loops. I had fun and saw it as a puzzle that needed to be solved through trial and errors. --- drawing.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 11 deletions(-) diff --git a/drawing.py b/drawing.py index f3ee2e9..08c60bb 100644 --- a/drawing.py +++ b/drawing.py @@ -6,17 +6,73 @@ from turtle import ( penup, pendown, color, + circle, + shape ) -forward(100) -right(360 * 2 / 5) -forward(100) -right(360 * 2 / 5) -forward(100) -right(360 * 2 / 5) -forward(100) -right(360 * 2 / 5) -forward(100) -right(360 * 2 / 5) -input() +lst=["purple","gold","green","blue","teal"] +for x in range(20,100,25): + color(lst[x%4]) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + +for m in range(4): + penup() + left(90) + forward(50) + pendown() + + for x in range(20,100,25): + color(lst[x%4]) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + penup() + forward(100) + right(360 * 2 / 5) + pendown() + circle(x) + + +input() \ No newline at end of file