Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 10, 2020 05:55
Show Gist options
  • Save uncoded-ro/5e8f4d0fe1b4d996d79069cede26297d to your computer and use it in GitHub Desktop.
Save uncoded-ro/5e8f4d0fe1b4d996d79069cede26297d to your computer and use it in GitHub Desktop.
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