Advertisement
FelipeNeto2

Exercise POO(Python)

Dec 17th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. #3
  2. class Smartphone():
  3.   def __init__(self, tamanho, interface):
  4.     self.tamanho = tamanho
  5.     self.interface = interface
  6.  
  7. class MP3Player(Smartphone):
  8.   def __init__(self, tamanho, interface, capacidade):
  9.     Smartphone.__init__(self, tamanho, interface)
  10.     self.capacidade = capacidade
  11.  
  12.   def especif(self):
  13.     return "Tamanho: {}, Interface: {}, Capacidade: {}".format(self.tamanho, self.interface, self.capacidade)
  14.  
  15. p3 = MP3Player(123, "android", 1024)
  16.  
  17. print(p3.especif())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement