1. (5 points) The following is the __init__ method of the Rectangle class we described in class. Show what you'd change to add positional notation (the coordinates of the upper left corner). class Rectangle (object): """Define a class of rectangles. Rectangles have an associated height and width.""" def __init__(self, height, width): self._height = height self._width = width Replace with: def __init__(self, height, width, x, y): self._height = height self._width = width # You can call these anything you like: self._xPos = x self._yPos = y ---------------------------------------------------------------------- 2. (5 points) Write a Boolean-valued method for the extended Rectangle class from question 1 that checks whether a given point is inside the rectangle. def inRectangle( self, x1, y1): return ( x1 >= self._xPos and x1 <= self._xPos + self._width and \ y1 <= self._yPos and y1 >= self._yPos - self._height ) ---------------------------------------------------------------------- 3. (10 points) The following is part of the implementation of the Widget class we showed in class: class Widget: def __init__(self, tag, priority): self._tag = tag self._priority = priority def __str__(self): return "< " + self._tag + ", " + str(self._priority) + " >" def __lt__(self, other): return self._priority < other._priority def __eq__(self, other): return self._priority == other._priority Suppose we have executed: w1 = Widget("red", 2) w2 = Widget("white", 3) w3 = Widget("blue", 1) w4 = Widget("orange", 2) What is printed or returned by each of the following: (a) >>> print(w1) < red, 2 > (b) >>> (w1 < w2) True (c) >>> str(w3) '< blue, 1 >' (d) >>> w1 == w4 True (e) >>> w3._tag 'blue'