Advertisement
pacho_the_python

heavy_hardware

Aug 8th, 2022
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. from project.hardware.hardware import Hardware
  2.  
  3.  
  4. class HeavyHardware(Hardware):
  5.     def __init__(self, name: str, capacity: int, memory: int):
  6.         super().__init__(name, "Heavy", capacity, memory)
  7.  
  8.     @property
  9.     def capacity(self):
  10.         return self.__capacity
  11.  
  12.     @capacity.setter
  13.     def capacity(self, value):
  14.         result = value * 2
  15.         self.__capacity = result
  16.  
  17.     @property
  18.     def memory(self):
  19.         return self.__memory
  20.  
  21.     @memory.setter
  22.     def memory(self, value):
  23.         result = int(value * 0.75)
  24.         self.__memory = result
  25.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement