-
-
Save uncoded-ro/5e8f4d0fe1b4d996d79069cede26297d 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 __str__(self): | |
return "{0}, {1}, {2}".format(self.__nume, self.__varsta, __class__.numar_persoane) | |
def se_prezinta(self): | |
print("Buna! Numele meu este {} si am {} ani.".format(self.get_nume(), self.__varsta)) | |
def set_nume(self, nume): | |
self.__nume = nume | |
def get_nume(self): | |
return self.__nume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment