Skip to content

Commit 93ae509

Browse files
creazione classe persona
1 parent 1617847 commit 93ae509

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

persona.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from abc import ABCMeta, abstractmethod
2+
3+
4+
from abc import ABCMeta
5+
6+
class Persona(metaclass=ABCMeta):
7+
def __init__(self,nome, cognome, data_nascita):
8+
self._nome=nome
9+
self._cognome=cognome
10+
self._data_nascita=data_nascita
11+
12+
#getter
13+
def get_name(self):
14+
return self._nome
15+
16+
17+
# getter
18+
def get_cognome(self):
19+
return self._cognome
20+
21+
# getter
22+
def get_data_nscita(self):
23+
return self._data_nascita
24+
25+
26+
def mangia(self):
27+
print('la persona sta mangiando')
28+
29+
def cammina(self):
30+
print('la persona sta camminando')
31+
32+
def dorme(self):
33+
print('la persona sta dormendo')

0 commit comments

Comments
 (0)