7th

Drawing in Python

In Python, I drew Captain America's shield. To draw Captain America's shield, I basically had to draw four circles and a star in the middle. Some problems with drawing this were drawing the star and filling it in. The way I overcame this was following a tutorial on how to make a star, but when I filled it in it only filled in the edges. The way I overcame this was making a upside down hexagon inside the star so it appeared as if it was all filled in. Drawing this in Python was difficult, but I liked the challenge. It was fun learning how to draw by writing it in code.

import turtlecap = turtle.Turtle()cap.speed(0)turtle.bgcolor('#003366')#Moving into positioncap.penup()cap.right(90)cap.forward(200)cap.right(270)#1st Red Circlecap.pendown()cap.begin_fill()cap.color('#F62A2A')#r cirlecap.circle(210)cap.end_fill()#White Circlecap.color('#FFFFFF')cap.left(90)cap.penup()cap.forward(40)cap.right(90)cap.pendown()cap.begin_fill()#w circlecap.circle(170)cap.end_fill()cap.penup()#2nd Red Circlecap.left(90)cap.forward(40)cap.pendown()cap.right(90)cap.begin_fill()cap.color('#F62A2A')#r circlecap.circle(130)cap.end_fill()#Blue Circlecap.penup()cap.left(90)cap.forward(40)cap.right(90)cap.pendowncap.begin_fill()cap.color('#1626AF')#b circlecap.circle(90)cap.end_fill()#Starcap.color("white")cap.left(90)cap.penup()cap.forward(90)cap.left(90)cap.forward(90)cap.right(90)cap.forward(27cap.right(90)cap.forward(7)cap.pendown()cap.begin_fill()#drawing starfor i in range(5): cap.forward(165) cap.right(144)cap.end_fill()cap.forward(63)cap.begin_fill()for i in range(5): cap.forward(39) cap.right(72)cap.end_fill()cap.hideturtle()