-
-
Save uncoded-ro/38c530c8d5ecf08b40656ed011a27a90 to your computer and use it in GitHub Desktop.
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 Persoana(): | |
"""Clasa Persoana""" | |
numar_persoane = 0; | |
def __init__(self, nume, varsta): | |
self.nume = nume | |
self.varsta = varsta | |
__class__.numar_persoane += 1 | |
def se_prezinta(self): | |
print("Buna! Numele meu este {} si am {} ani.".format(self.nume, self.varsta)) | |
def __str__(self): | |
return "{0}, {1}, {2}".format(self.nume, self.varsta, __class__.numar_persoane) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment