48:41Extend and enhance your analytics applications with Microsoft Fabric | BRK162
Microsoft Developer
python calculator program project tutorial example explained #python #calculator #program # **************************************************************** # Python Calculator # **************************************************************** from tkinter import * def button_press(num): global equation_text equation_text = equation_text + str(num) equation_label.set(equation_text) def equals(): global equation_text try: total = str(eval(equation_text)) equation_label.set(total) equation_text = total except SyntaxError: equation_label.set("syntax error") equation_text = "" except ZeroDivisionError: equation_label.set("arithmetic error") equation_text = "" def clear(): global equation_text equation_label.set("") equation_text = "" window = Tk() window.title("Calculator program") window.geometry("500x500") equation_text = "" equation_label = StringVar() label = Label(window, textvariable=equation_label, font=('consolas',20), bg="white", width=24, height=2) label.pack() frame = Frame(window) frame.pack() button1 = Button(frame, text=1, height=4, width=9, font=35, command=lambda: button_press(1)) button1.grid(row=0, column=0) button2 = Button(frame, text=2, height=4, width=9, font=35, command=lambda: button_press(2)) button2.grid(row=0, column=1) button3 = Button(frame, text=3, height=4, width=9, font=35,
Published 2021-02-01 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
48:41Microsoft Developer
44:22
43:23Microsoft Developer
42:51
41:18Microsoft Developer
06:26Microsoft Developer
56:48Allow Google Analytics to measure visits. Your history stays in your browser. Privacy details