Write a program that will draw a red circle on top of a blue square in the center of the canvas. The blue square should have sides of 100 pixels each and the red circle should have a diameter of 100 pixels


it's thru codehs and it's due tomorrow so

Respuesta :

Answer:

Explanation:

The following code is written in Python. It uses the imports the turtle class in order to be able to draw a blue square with 100pixels per side and then a red circle with a diameter of 100 pixels that fits perfectly inside the square.

import turtle

t = turtle.Turtle()

#Make Square

t.fillcolor('blue')

t.begin_fill()

t.back(50)

for i in range(4):

 t.forward(100)

 t.left(90)

t.end_fill()

#Make Circle

t.forward(50)

t.fillcolor('red')

t.begin_fill()

t.circle(50)

t.end_fill()

ACCESS MORE