From 2fb9473b083313cf0cdf044116d2be6a097a70a0 Mon Sep 17 00:00:00 2001 From: Diana Panarello Date: Tue, 3 Sep 2024 19:18:52 -0400 Subject: [PATCH] I made a red octagon with the word STOP inside to mimic a stop sign. I felt determined to learn some other codes that were not mentioned in the article. I imported the code 'write' and 'set position' in order to add the word STOP and to make it go inside of the octagon. Although I was able to figure out the codes, I became determined to make the word STOP as center as possible in the octagon, which took many trials and errors to get it as close as I could. --- drawing.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drawing.py b/drawing.py index f3ee2e9..72ab56a 100644 --- a/drawing.py +++ b/drawing.py @@ -6,17 +6,30 @@ from turtle import ( penup, pendown, color, + write, + setposition ) +color('red') +right(45) forward(100) -right(360 * 2 / 5) +right(45) forward(100) -right(360 * 2 / 5) +right(45) forward(100) -right(360 * 2 / 5) +right(45) forward(100) -right(360 * 2 / 5) +right(45) forward(100) -right(360 * 2 / 5) +right(45) +forward(100) +right(45) +forward(100) +right(45) +forward(100) +penup() +setposition(-145,-160) +style = ('Times New Roman', 75, 'bold') +write('STOP', font=style) input()