Jed Rembold
March 18, 2026

self properly within our method
definitionsWhat would be the output of the last print statement in the code to the right?
class Demo:
def __init__(self):
self.x = []
def add(self, v):
self.x.append(v)
def get_x(self):
return self.x
A, B = Demo(), Demo()
C = B.get_x()
A.add(3)
B.add(3)
C.append(A)
print(A.get_x() == B.get_x())
turn_on that sets the
boolean to True and the brightness to 100
when calledturn_off that ets the
boolean to False and the brightness to 0
when called__repr__ method'[Kitchen: ON @ 100%]' or
'[Kitchen: OFF]'
__str__ and running it to compare the
outputtoggle which
toggles the state of the light
get_brightness)
to return the current bulb brightness levelset_brightness)
which takes a new percentage as an argument
