Python Questions. Send Code via .py files please

Week 3: Python Assignment 3 1) Write a python program to create a class definition for rectangle: The rectangle has two variables: height and width and two methods area and perimeter. W rite a main program to get instance of the class rectangle, then compute its area and perimete r by calling the methods. Main program sample : r = Rectangle( 5, 4 ) # width 5 and height 4 area = r.area() perimeter = r.perimeter() # print area and perimeter Add the following methods to the rectangle class : 1) getHeight() that returns the height of the rectangle 2) getWidth that returns the width of the rectangle 3) setHeight(h) that sets the height of the rectangle to a new value h 4) setWidth(w) that sets the width of the rectangle to a new value w Test the above methods with something like: r = Rectangle(5, 4) area = r.area() perimeter = r.perimeter() r.setWidth(10) r.setHeight(15) area = r.area() perimeter = r.perimeter() # print h eight and width by calling the methods getHeight and getWidth # print area and perimeter Write a separate function (not inside the rectangle) , area_difference , that takes two Rectangle instances as parameters and returns the signed difference in area between them. "signed difference" means that rather than always returning a positive number, the sign of the return value should be negative if the first rectangle is smaller. Test your code with: r1 = Rectangle (10, 10) r2 = Rectangle (15, 20) # print with a suitable message : the area difference by calling the # method area_difference(r 1, r2) 2) Write a python program to read a file shape.txt that contains a maze shape as follows : "********** " "* *" "* *** * *** *" "* *" "**********" Each star is a boxes of width=40 and height=40. Your program should draw for each star a small square of size (40, 40) using create_rectangle in t kinter The output should be something like: Extend your program to include P for pla yer at any location in the maze; like: "********** " "* P *" "* *** * *** *" "* *" "**********" And the output is: One way to do Pacman is to use create_arc and create_oval; the syntax as follows: canvas. create_ arc(top_left_col umn , top_left_row , bottom_right_col um n, bottom_right_row, start , extends , outline, fill , width): use the f ollowing parameters: start = 25 for start angle , extends =315 for end angle , fill="#ffff00" for yellow color , and outlin e="#000" fo r black color and width= 2 to draw the eye for pacman, use: canvas. create_oval (top_left_column , top_right_row , bottom_right_column, bottom_right_row , fill =fill_color , width ) use fill color fill="#000" for black color, and width=0.1