Skip to content

Commit 4527a03

Browse files
stage
1 parent a9e39b5 commit 4527a03

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

persona.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def __init__(self,nome, cognome, data_nascita, sesso, peso):
99
self._nome=nome
1010
self._cognome=cognome
1111
self._data_nascita=data_nascita
12-
self.sesso=sesso
13-
self.peso=peso
12+
self._sesso=sesso
13+
self._peso=peso
1414

1515
#getter
1616
def get_name(self):
@@ -27,11 +27,11 @@ def get_data_nscita(self):
2727

2828
# getter
2929
def get_sesso(self):
30-
return self.sesso
30+
return self._sesso
3131

3232
# getter
3333
def get_peso(self):
34-
return self.peso
34+
return self._peso
3535

3636
def mangia(self):
3737
print('la persona sta mangiando')
@@ -43,11 +43,11 @@ def dorme(self):
4343
print('la persona sta dormendo')
4444

4545
def __str__(self):
46-
return str(self._nome) + ' ' + str(self._cognome) + ' ' + str(self._data_nascita) + ' ' + str(self.sesso) + str(self.peso)
46+
return str(self._nome) + ' ' + str(self._cognome) + ' ' + str(self._data_nascita) + ' ' + str(self._sesso) + str(self._peso)
4747

4848
def __eq__(self,other):
4949
if isinstance(other):
50-
if other._nome==self._nome and other._cognome==self._cognome and other._data_nascita==self._data_nascita and other.sesso==self.sesso and other.peso==self.peso:
50+
if other._nome==self._nome and other._cognome==self._cognome and other._data_nascita==self._data_nascita and other._sesso==self._sesso and other._peso==self._peso:
5151
return True
5252
return False
5353

0 commit comments

Comments
 (0)