#chatgpt #bing #ai #machinelearning #computerscience #project #collegeproject #bitspilani #chandigarhuniversity #softwaredeveloper #softwareengineer
CODE:
from tkinter import *
expression = ""
def press(num):
global expression
expression = expression + str(num)
equation.set(expression)
def equalpress():
try:
global expression
total = str(eval(expression))
equation.set(total)
expression = ""
except:
equation.set(" error ")
expression = ""
def clear():
global expression
expression = ""
equation.set("")
if _name_ == "__main__":
gui = Tk()
gui.configure(background="light green")
gui.title("Simple Calculator")
gui.geometry("270x150")
equation = StringVar()
expression_field = Entry(gui, textvariable=equation)
expression_field.grid(columnspan=4, ipadx=70)
button1 = Button(gui, text=' 1 ', fg='black', bg='red', command=lambda: press(1), height=1, width=7)
button1.grid(row=2, column=0)
button2 = Button(gui, text=' 2 ', fg='black', bg='red', command=lambda: press(2), height=1, width=7)
button2.grid(row=2, column=1)
button3 = Button(gui, text=' 3 ', fg='black', bg='red', command=lambda: press(3), height=1, width=7)
button3.grid(row=2, column=2)
button4 = Button(gui, text=' 4 ', fg='black', bg='red', command=lambda: press(4), height=1, width=7)
button4.grid(row=3, column=0)
button5 = Button(gui, text=' 5 ', fg='black
Nesta página do site você pode assistir ao vídeo on-line Project Calculator | Python | Generative AI duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ankit Bishwas 16 Novembro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 63 vezes e gostou 2 espectadores. Boa visualização!