Advertisement
TornioSubito

Farmacia corretta

Jun 21st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. class Medicinale:
  2. def __init__(self,L):
  3. #@param L : list ([nome,disponibilita])
  4. self.L=L
  5.  
  6. class Farmacia:
  7. def __init__(self,nome,tel,ind,med):
  8. #@param nome : string
  9. #@param tel : string (of integers)
  10. #@param ind : string (indirizzo della farmacia)
  11. #@param med : list (lista di oggetti di tipo Medicinale)
  12. self.nome=nome
  13. self.tel=tel
  14. self.ind=ind
  15. self.med=med
  16.  
  17. def removeMed(self,medName):
  18. #@param medName : string
  19. for i in self.med:
  20. if self.med[i[0]]==medName:
  21. self.med.pop(i)
  22.  
  23. def addMed(self,newMed):
  24. #@param newMed : Medicinale
  25. self.med.append(newMed)
  26.  
  27. def getDisp(self,medName):
  28. #@param medName : string
  29. for i in self.med:
  30. if self.med[i[0]]==medName:
  31. return self.med[i[1]]
  32.  
  33.  
  34. class Farmacia_Notturna(Farmacia):
  35. def __init__(self,nome,tel,ind,med,orario):
  36. #@param nome : string
  37. #@param tel : string (of integers)
  38. #@param ind : string
  39. #@param med : list (of Medicinale objects)
  40. #@param orario : string
  41. Farmacia.__init__(self,nome,tel,ind,med)
  42. self.orario=orario
  43.  
  44. def getSchedule(self):
  45. return self.orario
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement