You are on page 1of 2

class Client:

def __init__(self,idn,nume,cnp):
'''
Functie ce initializeaza o variabila de tip client.
Input:
-ID, Nume, CNP
Output:
-
'''
self.__idn = idn
self.__nume = nume
self.__cnp = cnp

def getNume(self):
'''
Functie ce returneaza numele unei variabile de tip client.
Input:
-
Output:
-nume
'''
return self.__nume

def getCnp(self):
'''
Functie ce returneaza cnpul unei variabile de tip client.
Input:
-
Output:
-cnp
'''
return self.__cnp

def getIdn(self):
'''
Functie ce returneaza id-ul unei variabile de tip client.
Input:
-
Output:
-id-ul
'''
return self.__idn

def setNume(self,nume):
'''
Functie ce seteaza numele unei variabile de tip client.
Input:
-nume
Output:
-
'''
self.__nume = nume

def setCnp(self,cnp):
'''
Functie ce seteaza cnpul unei variabile de tip client.
Input:
-cnp
Output:
-
'''
self.__cnp = cnp

def __eq__(self, other):


'''
Functie ce verifica egalitatea a 2 variabile de tip client.
Input:
- other
Output:
- True, daca sunt egale. False altfel
'''
if isinstance(other,self.__class__):
return self.__idn == other.__idn
else:
return False

def __str__(self):
'''
Functie ce returneaza stringul format din parametrii unei variabile de tip
client.
Input:
-
Output:
- stringul format.
'''
return str(self.__idn) + " " + self.__nume + " " + self.__cnp + '\n'