Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Oggetto:
- Pz=0
- def __init__(self,nome,quantita,posizione):
- self.nome=nome
- self.quantita=quantita
- self.posizione=posizione
- Oggetto.Pz +=1
- def Info(self):
- return f'nome:{self.nome} \n quantità: {self.quantita}\n sito in {self.posizione}'
- og1=Oggetto('lima',2,'armadio1')
- og2=Oggetto('martello',1,'cassetto')
- og3=Oggetto ('torcia',2,'cassetto')
- og4=Oggetto('cacciaviti',7,'cassetto')
- print(Oggetto.Info(og1))
- print(og2.Info())
- print(Oggetto.Info(og3))
- print(og4.Info())
- print('Pezzi catalogati:',Oggetto.Pz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement