PCAP Object-Oriented Programming • Set 8
PCAP Object-Oriented Programming Practice Test 8 — 15 questions with explanations. Free, no signup.
Refer to the exhibit. What happens when the last line is executed?
class MyClass:
__slots__ = ('name', 'age')
def __init__(self, name, age):
self.name = name
self.age = age
obj = MyClass('John', 30)
obj.city = 'New York'