Python - Encapsulation and Data Protection
What is the issue with this code snippet?
class Bike:
def __init__(self, speed):
self._speed = speed
@property
def speed(self):
return self._speed
@speed.setter
def speed(self, value):
if value >= 0:
self._speed = value
b = Bike(20)
b.speed = -5