#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
На этой странице сайта вы можете посмотреть видео онлайн Project Calculator | Python | Generative AI длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Ankit Bishwas 16 Ноябрь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 63 раз и оно понравилось 2 зрителям. Приятного просмотра!