Está en la página 1de 2

# 31

nomarch= input("Ingrese un nombre de Archivo: ")


extension="txt"
abre = nomarch+".txt"
print (abre)
f = open(abre, "x")
frase = input ("ingrese frase ")
f.write(frase)
f.close()
#https://www.w3schools.com/

#32
j=11
for x in range (1,12):
print (x," ",j)
j-=1

#33 frase = input(" Ingrese Frase: ")

for i in range (0, len(frase)):


print(frase[i])
opcion=input("desea continuar Salir presione x")
if opcion == "x":
break

#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

También podría gustarte