From 48505ff278d35c14650ab0ca7a97e0245377c015 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Tue, 27 Dec 2022 23:19:22 -0500 Subject: [PATCH] add the code to hide the turtle drawing --- NigeriaFlag.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/NigeriaFlag.py b/NigeriaFlag.py index fc22a261..e98c2cb2 100644 --- a/NigeriaFlag.py +++ b/NigeriaFlag.py @@ -5,13 +5,12 @@ t = turtle.Turtle() # Use the shape method for the t object to switch to any shape to draw -#t.shape("arrow") +# t.shape("arrow") # Define/ Create a variable for diagram fullshape = 360 - -# Use the penup object to not draw on the screen +# Use the penup object to not draw on the screen t.penup() # Assign a color to you drawing and shape @@ -20,20 +19,23 @@ # Use the time module to wait before running the program. time.sleep(5) -# Create a function for the Drawing +# hide the turtle pen +t.hideturtle() + + +# Create a function for the Drawing def penDown(): - t.pensize(3) t.pendown() t.forward(100) - t.left(fullshape/4) - + t.left(fullshape / 4) + + # Create a function to not draw def penUp(): - t.penup() t.forward(100) - t.left(fullshape/4) + t.left(fullshape / 4) # Here is the begining of the function Line @@ -44,16 +46,15 @@ def penUp(): # Create a for loop to draw the square shape for _ in range(0, 4): penDown() - + # End the color inside the square shape t.end_fill() # print(t.position()) # Here is the blank/white flag -#placing the position for the white shape +# placing the position for the white shape t.goto(-50.0, 0.00) for noline in range(4): - penUp() # print the position of the box after drawing the shape @@ -64,12 +65,11 @@ def penUp(): t.begin_fill() # This is the function for the third side of the flag for thr in range(4): - penDown() t.end_fill() t.goto(140, 0.00) print(t.position()) - + # exits the Turtle display once the task is completed upon clicking the window turtle.exitonclick()