Created
January 24, 2018 05:45
-
-
Save marcoscastro/2fa4075ae1390bb2b703157e383a5ce8 to your computer and use it in GitHub Desktop.
Revisions
-
marcoscastro created this gist
Jan 24, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ class Pessoa: def __init__(self, nome, idade): self.nome = nome self.idade = idade def mostrar_nome(self): print(self.nome) def mostrar_idade(self): print(self.idade) class Estudante(Pessoa): def __init__(self, nome, idade, mat): Pessoa.__init__(self, nome, idade) self.mat = mat def mostrar_mat(self): print(self.mat) p = Pessoa("marcos", 30) p.mostrar_idade() s = Estudante("pedro", 20, 1000) s.mostrar_nome() s.mostrar_mat()