Hey guys I could really use some help writing this program f
Hey guys I could really use some help writing this program for python, it also wants it to display the image on turtle.... here\'s the problem:
Write a program that prompts the user to enter the center of a rectangle, width, and heigth and displays the rectangle.
Solution
from graphics import *
def makeRect(corner, width, height): # Incorrect!
\'\'\'Return a new Rectangle given one corner Point and the dimensions.\'\'\'
corner2 = corner
corner2.move(width, height)
return Rectangle(corner, corner2)
def main():
win = GraphWin(\'Draw a Rectangle (NOT!)\', 300, 300)
win.yUp()
rect = makeRect(Point(20, 50), 250, 200)
rect.draw(win)
win.promptClose(win.getWidth()/2, 20)
main()
