Skip to content

Commit f67a14a

Browse files
persona
1 parent 93ae509 commit f67a14a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

persona.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,13 @@ def cammina(self):
3030
print('la persona sta camminando')
3131

3232
def dorme(self):
33-
print('la persona sta dormendo')
33+
print('la persona sta dormendo')
34+
35+
def __str__(self):
36+
return str(self._nome) + ' ' + str(self._cognome) + ' ' + str(self._data_nascita)
37+
38+
def __eq__(self,other):
39+
if isinstance(other):
40+
if other._nome==self._nome and other._cognome==self._cognome and other._data_nascita==self._data_nascita:
41+
return True
42+
return False

0 commit comments

Comments
 (0)