Dimitar23308

dom.rab

Jan 20th, 2026
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. # class SpaceUtils:
  2. # @staticmethod
  3. # def light_years_to_km(sg):
  4. # return sg * 9.46*10**12
  5. -----------------------------------------
  6.  
  7. # class Pizza:
  8. # def __init__(self, ingredients):
  9. # self.ingredients = ingredients
  10.  
  11. # @classmethod
  12. # def margarita(cls):
  13. # return cls(["tomato sauce", "mozzarella", "basil"])
  14.  
  15. # @classmethod
  16. # def pepperoni(cls):
  17. # return cls(["tomato sauce", "mozzarella", "pepperoni"])
  18. ------------------------------------------------------------------------
  19.  
  20. # class GameServer:
  21. # status = "изключен"
  22.  
  23. # @classmethod
  24. # def m_mode(cls):
  25. # cls.status = "променен"
  26. # print("Сървърът е в променен режим. Добре дошли, бъдещи играчи!")
  27. ----------------------------------------------------------------------------
  28. # class FitnessTracker:
  29. # total_steps = 0
  30.  
  31. # def __init__(self):
  32. # self._steps = 0
  33.  
  34. # @property
  35. # def steps(self):
  36. # return self._steps
  37.  
  38. # @steps.setter
  39. # def steps(self, value):
  40. # if value < 0:
  41. # raise ValueError("Стъпките не могат да бъдат отрицателни.")
  42. # diff = value - self._steps
  43. # self._steps = value
  44. # FitnessTracker.total_steps += diff
  45.  
  46. # @staticmethod
  47. # def calculate_calories(steps):
  48. # return steps * 0.04
  49.  
  50. # @classmethod
  51. # def factory_reset(cls):
  52. # cls.total_steps = 0
  53. --------------------------------------------------------------------------
  54. # class AutoCar:
  55. # software_version = "1.0"
  56.  
  57. # def __init__(self):
  58. # self._speed = 0
  59.  
  60. # @property
  61. # def speed(self):
  62. # return self._speed
  63.  
  64. # @speed.setter
  65. # def speed(self, value):
  66. # self._speed = min(value, 130)
  67.  
  68. # @staticmethod
  69. # def is_speed_safe(speed, weather):
  70. # if weather == "rainy":
  71. # return speed <= 90
  72. # if weather == "sunny":
  73. # return speed <= 130
  74. # return False
  75.  
  76. # @classmethod
  77. # def update_software(cls, new_version):
  78. # cls.software_version = new_version
  79. ---------------------------------------------------------------------------
  80. # class Playlist:
  81. # def __init__(self):
  82. # self.songs = [] # всяка песен е (име, продължителност)
  83. # self._rating = 1
  84.  
  85. # @property
  86. # def total_duration(self):
  87. # return sum(duration for _, duration in self.songs)
  88.  
  89. # @property
  90. # def rating(self):
  91. # return self._rating
  92.  
  93. # @rating.setter
  94. # def rating(self, value):
  95. # if 1 <= value <= 5:
  96. # self._rating = value
  97. # else:
  98. # raise ValueError("Рейтингът трябва да е между 1 и 5.")
  99.  
  100. # @staticmethod
  101. # def validate_file_format(filename):
  102. # return filename.endswith(".mp3") or filename.endswith(".wav")
  103.  
Advertisement
Add Comment
Please, Sign In to add comment