Lab 10
Lab 10
TEMA:
Laboratorio N°10
ALUMNO:
SEMESTRE: 2024 – II
CUSCO
Actividades
Actividad 1
Para cada pregunta, tome como punto de partida el código anterior, agregue los siguientes
códigos y responda las preguntas correspondientes.
Actividad 2
Actividad 3
2. askyesno()
3. askretrycancel()
4. askyesnocancel()
5. askokcancel()
b) Anote la diferencia en cada caso
askquestion(): Retorna "yes" o "no". Es útil cuando necesitas una respuesta textual.
askretrycancel(): Retorna True para "Retry" y False para "Cancel". Se usa cuando el
usuario puede decidir reintentar o cancelar una operación.
Actividad 4
4. Pruebe el siguiente código
El resultado de este código es una caja de texto (Entry) de ancho considerable, colocada
en la parte superior de la ventana (fila 0)
Actividad 5
# Crear botones
# Fila 1
boton1 = Button(root, text='1', width=button_width,
height=button_height, bg='white', fg="black", font=('arial', 18,
'bold'), command=lambda: click('1'))
boton1.grid(row=1, column=0, padx=1, pady=1)
# Fila 2
boton4 = Button(root, text='4', width=button_width,
height=button_height, bg='white', fg="black", font=('arial', 18,
'bold'), command=lambda: click('4'))
boton4.grid(row=2, column=0, padx=1, pady=1)
boton5 = Button(root, text='5', width=button_width,
height=button_height, bg='white', fg="black", font=('arial', 18,
'bold'), command=lambda: click('5'))
boton5.grid(row=2, column=1, padx=1, pady=1)
# Fila 3
boton7 = Button(root, text='7', width=button_width,
height=button_height, bg='white', fg="black", font=('arial', 18,
'bold'), command=lambda: click('7'))
boton7.grid(row=3, column=0, padx=1, pady=1)
# Fila 4
boton_igual = Button(root, text='=', width=button_width,
height=button_height, bg='red', fg="black", font=('arial', 18, 'bold'),
command=lambda: click('='))
boton_igual.grid(row=4, column=0, padx=1, pady=1)
boton0 = Button(root, text='0', width=button_width,
height=button_height, bg='white', fg="black", font=('arial', 18,
'bold'), command=lambda: click('0'))
boton0.grid(row=4, column=1, padx=1, pady=1)