class SmartLight:
def __init__(self, name, bright):
self.name = name
self.set_brightness(bright)
def set_brightness(self, value):
if value < 0:
self.bright = 0
elif value > 100:
self.bright = 100
else:
self.bright = value
light = SmartLight("침실1", 150)
print(light.bright)
To embed this project on your website, copy the following code and paste it into your website's HTML: