Question: I'm trying to draw the bahamas flag using python but having trouble trying to put the triangle at the right position. This is my code
I'm trying to draw the bahamas flag using python but having trouble trying to put the triangle at the right position. This is my code right now.
import turtle
def main(): bahamas = turtle.Turtle() bahamas.shape("turtle")
bahamas.goto(0,0) for i in range(2): bahamas.fillcolor('MediumAquamarine') bahamas.begin_fill() bahamas.forward(300) bahamas.right(90) bahamas.forward(50) bahamas.right(90) bahamas.end_fill()
bahamas.goto(0,-50) for i in range(2): bahamas.fillcolor('yellow') bahamas.begin_fill() bahamas.forward(300) bahamas.right(90) bahamas.forward(50) bahamas.right(90) bahamas.end_fill()
bahamas.goto(0,-100) for i in range(2): bahamas.fillcolor('MediumAquamarine') bahamas.begin_fill() bahamas.forward(300) bahamas.right(90) bahamas.forward(50) bahamas.right(90) bahamas.end_fill()
bahamas.fillcolor('black') bahamas.begin_fill() bahamas.forward(131) bahamas.right(120) bahamas.forward(150) bahamas.right(120) bahamas.forward(131) bahamas.right(120) bahamas.end_fill()
turtle.hideturtle() main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
