Question

Write a Python graphics program that draws the following shapes: •    window size: 250 x 250...

Write a Python graphics program that draws the following shapes:
•    window size: 250 x 250 pixels with window title with your name
•    big circle, 50 pixels radius with center at (125, 125)
•    two green circles, 10 pixels radius; first one centered at (113, 113) and second centered at (137, 113)
•    one red line, from (100, 150) to (150, 150)

Then answer this, what do you see? (make this a comment in your code)

Homework Answers

Answer #1

##PLEASE ENTER YOUR NAME IN LINE NO 2 OF THE CODE, IT IS THE TITLE

CODE:

from graphics import *

name = "" ##ENTER YOUR NAME HERE

win = GraphWin(name,250,250)

cir = Circle(Point(125,125),50)
cir.draw(win)

cir1 = Circle(Point(113,113), 10)
cir1.setFill("green")
cir1.draw(win)

cir2 = Circle(Point(137,113), 10)
cir2.setFill("green")
cir2.draw(win)

line = Line(Point(100,150), Point(150, 150))
line.setFill('red')
line.draw(win)

win.getMouse()
##IT IS A FACE WITH GREEN EYES AND RED MOUTH

CODE PREVIEW:

OUTPUT:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Hi, I'm writing a Java program that prints a grid with circles and squares that have...
Hi, I'm writing a Java program that prints a grid with circles and squares that have letters in them and it is also supposed to print the toString() function to the console window each time the application runs. This toString() function is supposed to show the tile's shape, letter, and color component (or components). Could someone please review and debug my code to help me figure out why my toString() function is not working? import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton;...
IN JAVA Speed Control Problem: The files SpeedControl.java and SpeedControlPanel.java contain a program (and its associated...
IN JAVA Speed Control Problem: The files SpeedControl.java and SpeedControlPanel.java contain a program (and its associated panel) with a circle that moves on the panel and rebounds from the edges. (NOTE: the program is derived from Listing 8.15 and 8.16 in the text. That program uses an image rather than a circle. You may have used it in an earlier lab on animation.) The Circle class is in the file Circle.java. Save the program to your directory and run it...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT