






Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!







Nombre: Gabriel Mateo Luna Tipan Fecha: 17 /11/ Crear aplicativos basados en los programas desarrollados en el Taller 1, usando TKinter de Python siguiendo las instrucciones detalladas en clase.
cuadro1=Label(ventana,text='Primera coordenada separada por coma (x,y):',bg='white') cuadro1.place(x=10,y=40, width=250, height=30) entrada1=Entry(ventana,bg='light yellow') entrada1.place(x=280, y=40, width=100, height=30) cuadro2=Label(ventana,text='Segunda coordenada separada por coma (x,y):', bg='white') cuadro2.place(x=10,y=90, width=250, height=30) entrada2=Entry(ventana,bg='light yellow') entrada2.place(x=280, y=90, width=100, height=30) boton=Button(ventana,text='Calcular',command=promedio) boton.place(x=120,y=140, width=100, height=30) cuadro4=Label(ventana,text='Resultado', bg='light blue') cuadro4.place(x=10,y=200, width=100, height=30) entrada4=Entry(ventana, bg='light green') entrada4.place(x=120, y=200, width=100, height=30) ventana.mainloop()
entrada2.place(x=230, y=90, width=100, height=30) cuadro3=Label(ventana,text='Ingrese el primer lado (c)', bg='white') cuadro3.place(x=10,y=130, width=200, height=30) entrada3=Entry(ventana, bg='light yellow') entrada3.place(x=230, y=130, width=100, height=30) boton=Button(ventana,text='Calcular',command=promedio) boton.place(x=340,y=50, width=100, height=30) cuadro4=Label(ventana,text='Resultado', bg='light blue') cuadro4.place(x=10,y=170, width=100, height=30) entrada4=Entry(ventana, bg='light green') entrada4.place(x=120, y=170, width=250, height=30) ventana.mainloop()
def promedio(): n=entrada1.get() if int(n) < 2: resultado=("El numero de Fibonacci:",n) else: u = ((1+math.sqrt(5))/2) j = ((float(u)int(n)-(1-float(u))int(n))/math.sqrt(5)) resultado=("El numero de Fibonacci:",int(j)) entrada4.delete(0,'end') entrada4.insert(0,resultado) Descripcion=Label(ventana,text='Este programa calcula la (n) posicion de sucecion de Fibonacci') Descripcion.place(x=10,y=10,width=400, height=30) cuadro1=Label(ventana,text='Ingrese la (n) posicion de sucecion de Fibonacci ',bg='white') cuadro1.place(x=10,y=40, width=300, height=30) entrada1=Entry(ventana,bg='light yellow') entrada1.place(x=330, y=40, width=50, height=30) boton=Button(ventana,text='Calcular',command=promedio) boton.place(x=10,y=80, width=100, height=30) cuadro4=Label(ventana,text='Resultado', bg='light blue') cuadro4.place(x=10,y=120, width=100, height=30) entrada4=Entry(ventana, bg='light green') entrada4.place(x=120, y=120, width=200, height=30)
if int(D) <= 20: M=B[int(M)-1] else: M=B[int(M)] elif int(M)== 4: if int(D) <= 20: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 5: if int(D) <= 21: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 6: if int(D) <= 21: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 7: if int(D) <= 22: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 8: if int(D) <= 23: M=B[int(M)-1] else: M=B[int(M)]
elif int(M) == 9: if int(D) <= 23: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 10: if int(D) <= 23: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 11: if int(D) <= 22: M=B[int(M)-1] else: M=B[int(M)] elif int(M) == 12: if int(D) <= 21: M=B[int(M)-1] else: M=B[0] C=entrada2.get() D1,M1,An1=C.split('/') Tiempo=(int(An1)-int(An)) if int(Tiempo)<=50: Años=50-Tiempo Meses=(int(Años)12)-int(M1) Dias=(int(Años)365)-((int(M1)*30)+int(D1)) resultado_1=("Le quedan",Años,"Años",Meses,"meses y",Dias,"dias de vida")
entrada5=Entry(ventana, bg='light blue') entrada5.place(x=110, y=130, width=300, height=30) ventana.mainloop()