Generation

generate functionMon, 03 Jul 2023

hacer un programa usando combobox que contenga sumar y restar usando Interfaz gráfica (GUI):

import tkinter as tk def suma(): dato1=int(textBox1.get()) dato2=int(textBox2.get()) resultado=dato1+dato2 resultadoLabel.config(text="El resultado es: %s"%resultado) def resta(): dato1=int(textBox1.get()) dato2=int(textBox2.get()) resultado=dato1-dato2 resultadoLabel.config(text="El resultado es: %s"%resultado) window = tk.Tk() window.title("Calculadora") window.geometry('300x200') textBox1=tk.Entry(window) textBox1.grid(column=1, row=1) textBox2=tk.Entry(window) textBox2.grid(column=1, row=2) resultadoLabel=tk.Label(window, text="El resultado es: "

Questions about programming?Chat with your personal AI assistant