Calculator App - Part 3
In this lesson, we will add additional features like subtraction, multiplication, and division to our calculator app.
We'll cover the following...
Now we will implement other mathematical functions using the OptionMenu widget. This will allow the user to choose the operation they want to perform.
Adding an OptionMenu widget
Let’s create a label and an OptionMenu with four options: “add”, “subtract”, “multiply”, and “divide”.
Press + to interact
opLabel = tk.Label(text = "Select the Operation: ")opLabel.grid(column=0,row=2)myOption = tk.StringVar(window)myOption.set("Select")opMenu = tk.OptionMenu(window, myOption, "Add","Subtract", "Multiply", "Divide")opMenu.grid(column=1,row=2)
Now, the ...