Advertisement
hackloper775

clases_py

Jul 11th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. class Pc(object):
  4.     def __init__(self):
  5.         self.partes = ['hardaware','software']
  6.         self.stdout = 'pantalla'
  7.         self.stdin = 'teclado'
  8.         self.nombre = 'Pc'
  9.        
  10. class Netbook(Pc):
  11.     def __init__(self,arch,sistema,procesador):
  12.         Pc.__init__(self)
  13.         self.arch = arch
  14.         self.portable = 'muy portatil'
  15.         self.sistema = sistema
  16.         self.procesador = procesador
  17.     def ver(self):
  18.         print ('Una netbook %s arquitectura %s' %(self.procesador,self.arch))
  19.         print ('Contiene un sistema %s y es %s' %(self.sistema,self.portable))
  20.         print ('Es de la familia %s' %(self.nombre))
  21.         for i in self.partes:
  22.             print ('Partes : %s' %(i))
  23.            
  24. hp_mini = Netbook("x86","GNU/Linux","intel")
  25. hp_mini.ver()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement