figure python calculator in action of buttons we can keep track of these gui widgets with instance variables the user interaction can be managed by set of methods that manipulate the widgets to implement this division of laborwe will create calculator class that represents the calculator in our program the constructor for the class will create the initial interface we will make the calculator respond to user interaction by invoking special run method constructing the interface let' take detailed look at the constructor for the calculator class firstwe'll need to create graphics window to draw the interface def __init__(self)create the window for the calculator win graphwin("calculator"win setcoords( , , , win setbackground("slategray"self win win the coordinates for the window were chosen to simplify the layout of the buttons in the last linethe window object is tucked into an instance variable so that other methods can refer to it the next step is to create the buttons we will reuse the button class from last since there are lot of similar buttonswe will use list to store them here is the code that creates the button listcreate list of buttons start with all the standard sized buttons bspecs gives center coords and label of buttons