From f19bae7994465bb09f79619043e4e9b86d7c5075 Mon Sep 17 00:00:00 2001 From: mbhatti4 Date: Sun, 5 Oct 2025 16:56:16 -0400 Subject: [PATCH] Submit 3: Here i wrote the code for drawing the full butterfly by calling the other functions. I just put temprorary values to just get the program to work for now. I will be asjusting it next submit. I also realized why it wasnt working before..i never called any function! The program now works, but need adjustments. I struggled with the bakground color so i simply looked up how to choose a background color on python on google and found an easy solution. --- drawing.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drawing.py b/drawing.py index a51ef54..22bc4fb 100644 --- a/drawing.py +++ b/drawing.py @@ -9,11 +9,10 @@ from turtle import * from turtle import forward, right from superturtle.movement import fly, no_delay -fly(-150, 150) -with no_delay(): - for i in range(720): - forward(300) - right(71) +import turtle + +screen = turtle.Screen() +screen.bgcolor("cadetblue") def draw_oval(width, height, color): fillcolor(color) @@ -28,7 +27,7 @@ def draw_wing(x, y, width, height, color, angle): goto(x, y) setheading(angle) pendown() - draw_oval(t, width, height, color) + draw_oval(width, height, color) def draw_body(): @@ -38,4 +37,19 @@ def draw_body(): pendown() draw_oval(10,45,"black") +def draw_butterfly(): + draw_body() + + draw_wing(-10,-60, 60, 120, "purple",120) + draw_wing(-10,-40, 40, 60, "pink", 130) + + draw_wing(10,-60, 60, 120, "purple",120) + draw_wing(10,-40, 40, 60, "pink", 130) + + +draw_butterfly() + + + + input() \ No newline at end of file