Tkinter Lesson 4 Exercises: lambda and Button commands
Each assignment should omit the root.mainloop() method call at the end of the code. Also, each program must include a title for the window. Save these programs as tk4-1.py, tk4-2.py, etc.
Exercise 1:
Make a program that has seven color buttons (buttons with a color name on them) and one display area (button or label). When a color button is pressed, the name of the color is displayed in the display area and the area turns that color.
Exercise 2:
Make the calculator number buttons work. When a number is pressed, that number should be added to the display line.
Exercise 3:
Make the calculator fully functional. Set it so that if the user types the [Enter] button in the entry box the calculator will respond the same as if they had pressed the "Calculate" button on the GUI.
Restricted access |