Created
August 4, 2014 19:16
-
-
Save ricardosiri68/e63c147d3fcce10005f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Funcion: | |
''' | |
cada function tiene un nombre y un precio | |
''' | |
def __init__(self, nombre, precio): | |
self.setNombre(nombre) | |
self.setPrecio(precio) | |
def setNombre(self, nombre): | |
self.__nombre = nombre | |
def setPrecio(self, precio): | |
self.__precio = precio | |
def nombre(self): | |
return self.__nombre | |
def precio(self): | |
return self.__precio | |
class Teatro: | |
''' | |
cada tratro tiene un nombre una direccion y realiza 4 funciones por dia | |
''' | |
def __init__(self, nombre, direccion, funciones): | |
self.setNombre(nombre) | |
self.setDireccion(direccion) | |
self.setFunciones(funciones) | |
def setNombre(self, nombre): | |
self.__nombre = nombre | |
def setDireccion(self, direccion): | |
self.__direccion = direccion | |
def setFunciones(self, funciones): | |
self.__funciones = funciones | |
def nombre(self): | |
return self.__nombre | |
def direccion(self): | |
return self.__direccion | |
def funciones(self): | |
return self.__funciones | |
if __name__ == '__main__': | |
colon = Teatro( | |
'colon', | |
'calle 123 falsa', | |
[ | |
Funcion('El champange las pone mimosas', 500.00), | |
Funcion('Dejate de joder', 300.00), | |
Funcion('A Inventar', 250.00), | |
Funcion('Nombres de Funciones', 350.00) | |
] | |
) | |
print "Teatro %30s - %s" % (colon.nombre(), colon.direccion()) | |
print "Funciones:" | |
for f in colon.funciones(): | |
print "%30s - $ %8.2f" % (f.nombre(), f.precio()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment