Asd
Asd
Asd
button_click(9))
# A Decimial button
button_decimal = tkinter.Button(
root, text=".", padx=30, pady=20, font=('Arial', 10, 'bold'), command=lambda:
button_decimal())
def button_click(number):
current = enter.get()
enter.delete(0, tkinter.END)
enter.insert(0, str(current) + str(number))
# Function to clear enter box
def button_clear():
enter.delete(0, tkinter.END)
def button_decimal():
current = enter.get()
if "." not in current:
enter.delete(0, tkinter.END)
enter.insert(0, str(current) + ".")
def button_operation(operation):
global math_operation
math_operation = operation
global first_number
first_number = float(enter.get())
enter.delete(0, tkinter.END)
def button_equal():
second_number = float(enter.get())
enter.delete(0, tkinter.END)
if math_operation == "+":
enter.insert(0, first_number + second_number)
elif math_operation == "-":
enter.insert(0, first_number - second_number)
elif math_operation == "*":
enter.insert(0, first_number * second_number)
elif math_operation == "/":
enter.insert(0, first_number / second_number)