Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class persona():
- nombre = ""
- edad = 0
- DNI = 0
- sexo = ""
- peso = 0.0
- altura = 0.0
- def __init__(self):
- self.nombre = "Hernan"
- self.edad = 19
- def defecto2(self):
- self.nombre = "Hernan"
- self.edad = 19
- self.sexo = "M"
- def skere(self, nombre, edad, DNI, sexo, peso, altura):
- self.nombre = nombre
- self.edad = edad
- self.DNI = DNI
- self.sexo = sexo
- self.peso = peso
- self.altura = altura
- def valores(self):
- return self.nombre
- return self.edad
- return self.DNI
- return self.sexo
- return self.peso
- return self.altura
- def obtenerdatos(self):
- while True:
- print("-----MENU-----\n")
- print("1. AGREGAR DATOS")
- print("2. MOSTRAR DATOS")
- print("3. SALIR")
- opcion = input("Seleccione una opcion: ")
- if(opcion=="1"):
- a = input("Nombre: ")
- b = input("Edad: ")
- c = input("DNI: ")
- d = input("Sexo: ")
- e = input("Peso: ")
- f = input("Altura: ")
- self.skere(a,b,c,d,e,f)
- elif(opcion=="2"):
- print(self.valores(a))
- print(self.valores(b))
- print(self.valores(c))
- print(self.valores(d))
- print(self.valores(e))
- print(self.valores(f))
- elif(opcion=="3"):
- break
- else:
- print("Opcion incorrecta")
- clase = persona()
- clase.obtenerdatos()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement