Ask Question
12 June, 11:03

Given the following code, what are the dimensions, in pixels, of the shape created? import tkinter class myShape: def __init__ (self) : self. main_window = tkinter. Tk () self. canvas = tkinter. Canvas (self. main_window, width=200, height=200) self. canvas. create_rectangle (30,30, 175, 175) self. canvas. pack () tkinter. mainloop () shape = myShape ()

+4
Answers (1)
  1. 12 June, 12:33
    0
    Width: 145 px, Height: 145 px

    Explanation:

    To build a figure in Python with canvas, remember that drawing a rectangle is represented with self. canvas. create_rectangle (x1, y1, x2, y2), where x1, y1 are the coordinates of the top left corner of the figure, and x2, y2, the coordinates of the bottom right corner.

    Based on your data, the shape formed will not be a rectangle, but a square. The measures in x2, y2 are equal, so a square figure will form. For example, if you had (30,30,175,150) this would create a rectangle figure.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Given the following code, what are the dimensions, in pixels, of the shape created? import tkinter class myShape: def __init__ (self) : ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers