Skip to content

Instantly share code, notes, and snippets.

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