PCAP Object-Oriented Programming • Set 5
PCAP Object-Oriented Programming Practice Test 5 — 15 questions with explanations. Free, no signup.
Refer to the exhibit. What is the output?
class Circle:
def __init__(self, radius):
self._radius = radius
@property
def radius(self):
return self._radius
@radius.setter
def radius(self, value):
if value > 0:
self._radius = value
c = Circle(5)
c.radius = -3
print(c.radius)