Python - Encapsulation and Data Protection
How do you correctly declare a protected attribute named
_level inside a Python class?_level inside a Python class?self.self._level.self._level = 0 inside __init__. def __init__(self): self.level = 0 lacks underscore, C uses double underscore (private), D assigns to a local variable.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions