This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Empleado(): | |
__nombre = None # podes definir atributos fuera del __init__ | |
def __init__(self,nombre = None): # poniendo nombre = None seteas de forma | |
# predeterminada el parametro nombre para que sea nulo si no se le asigna ningun valor al parametro | |
# self solo existe dentro de la definicion de la clase del objeto y no afuera | |
# self representa la instancia misma del objeto por lo que no exite si no existe | |
# una instancia del objeto | |
self.setNombre(nombre) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Programador: | |
__brainState = False | |
def setBrainState(self,value): | |
if "si" == value: | |
self.__brainState = True | |
elif "no" == value: | |
self.__brainState = False | |
else: | |
print "el estado del cerebro que quiere establecer no es el correcto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
ayuda = """ | |
"ADD":añadir una nueva empresa, | |
"USE":seleccionar una empresa de la lista por su nombre, USE [nombre de la empresa]. | |
"VETERANO":obtener los datos del empleado con mayor antiguedad en la empresa. | |
"COMPARAR":comparar la empresa seleccionada con otra ingresando el nombre de esta ultima COMPARAR [nombre de la empresa] | |
"FUSIONAR":fusionar la empresa selaccionada con otra ingresando el nombre de esta ultima FUSIONAR [nombre de la empresa] | |
"SET":reescribir atributos de la empresa seleccionada [ opciones: NOMBRE, DESCRIPCION], SET [opcion] [valor] | |
"EMPRESAS":lista todas las empreas existentes | |
"DELETE": borra una empresa pasando el nombre como argumento. De no recibir argumento borra la empresa seleccionada, DELETE [nombre de la empresa] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cuando te pida un telefono elegi uno de los numeros que se encuentran abajo | |
# c/u tiene su saldo establecido suerte | |
telefono_saldos = { | |
"235234541":23.0, # siii aca !! | |
"234556343":40.7, | |
"444562212":0.23 | |
} | |
recargado = { | |
'a12345b+12345':500, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Persona: | |
def __init__(self,apellido,nombre,ocupacion,edad): | |
self.__apellido=apellido | |
self.__nombre=nombre | |
self.__ocupacion=ocupacion | |
self.__edad=edad | |
def setApellido(self,__apellido): | |
self.__apellido=__apellido | |
def getApellido(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new(): | |
return [] | |
def apilar(pila,elem): | |
pila.append(elem) | |
def desapilar(pila): | |
return(pila.pop()) | |
def invertir(pila): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pila | |
p=pila.new() | |
p2=pila.new() | |
aux=pila.new() | |
for i in range(0,5): | |
elem=input() | |
pila.apilar(p,elem) | |
print p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new(): | |
return [] | |
def apilar(pila,elem): | |
pila.append(elem) | |
def desapilar(pila): | |
return(pila.pop()) | |
def invertir(pila): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new(): | |
return [] | |
def apilar(pila,elem): | |
pila.append(elem) | |
def desapilar(pila): | |
return(pila.pop()) | |
def invertir(pila): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def recSC(n): | |
if n==1.0: | |
return 1.0 | |
else: | |
n=math.sqrt(math.sin(n)**2+math.cos(n)**2) | |
return n*recSC(n) | |
print recSC(10) |