Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ejercios en Python 2
Ejercios en Python 2
#32
j=11
for x in range (1,12):
print (x," ",j)
j-=1
#34
frase = input ("ingrese frase: ")
for x in reversed (frase):
print(x)
#35
frase = input(" Ingrese un texto: ")
lf= len(frase)-1
i = 1
while lf > -1:
print(frase[lf])
lf = lf-1
i = 1
while i < 6:
print(i,"",end="")
i += 1
#36
from tkinter import *
raiz= Tk()
miFrame=Frame(raiz, width=800,height=600)
miFrame.pack()
minombre= StringVar()
cuadroNombre=Entry(miFrame, textvariable=minombre)
cuadroNombre.grid(row=0, column=1)
cuadroApellido=Entry(miFrame)
cuadroApellido.grid(row=1, column=1)
cuadroDireccion=Entry(miFrame)
cuadroDireccion.grid(row=2, column=1)
nombreLabel=Label(miFrame, text="Nombre:")
nombreLabel.grid(row=0, column=0, sticky="e")
ApellidoLabel=Label(miFrame, text="Apellido:")
ApellidoLabel.grid(row=1, column=0,sticky="e")
DireccionLabel=Label(miFrame, text="Direccion:")
DireccionLabel.grid(row=2, column=0, sticky="e")
def codigoBoton():
minombre.set("Victor")
botonEnvio=Button(raiz, text="Enviar", command= codigoBoton)
botonEnvio.pack()
raiz.mainloop()
#35