introduction to gui programming self rate tkinter doublevar(self rate set( self years tkinter intvar(self amount tkinter stringvar(tk allows us to create variables that are associated with widgets if variable' value is changed programmaticallythe change is reflected in its associated widgetand similarlyif the user changes the value in the widget the associated variable' value is changed here we have created two "doublevariables (these hold float values)an integer variableand string variableand have set initial values for two of them principallabel tkinter label(selftext="principal $:"anchor=tkinter wunderline= principalscale tkinter scale(selfvariable=self principalcommand=self updateuifrom_= to= resolution= orient=tkinter horizontalratelabel tkinter label(selftext="rate %:"underline= anchor=tkinter wratescale tkinter scale(selfvariable=self ratecommand=self updateuifrom_= to= resolution= digits= orient=tkinter horizontalyearslabel tkinter label(selftext="years:"underline= anchor=tkinter wyearsscale tkinter scale(selfvariable=self yearscommand=self updateuifrom_= to= orient=tkinter horizontalamountlabel tkinter label(selftext="amount $"anchor=tkinter wactualamountlabel tkinter label(selftextvariable=self amountrelief=tkinter sunkenanchor=tkinter ethis part of the initializer is where we create the widgets the tkinter label widget is used to display read-only text to the user like all widgets it is created with parent (in this case--and as usual--the parent is the containing widget)and then keyword arguments are used to set various other aspects of the widget' behavior and appearance we have set the principallabel' text appropriatelyand set its anchor to tkinter wwhich means that the label' text is aligned west (leftthe underline parameter is used to specify which character in the label should be underlined to indicate keyboard accelerator ( alt+ )further on we will see how to make the accelerator work ( keyboard accelerator is key sequence of the form alt+letter where letter is an underlined letter and which results in the keyboard focus being switched to the widget associated with the acceleratormost commonly the widget to the right or below the label that has the accelerator