Last active
April 12, 2019 19:16
-
-
Save dmytrostriletskyi/87b16ee683b5c14c8d415956ce42649e to your computer and use it in GitHub Desktop.
Python access modifiers agreement in use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car: | |
def _start_engine(self): | |
return "Engine's sound." | |
def run(self): | |
return self._start_engine() | |
if __name__ == '__main__': | |
car = Car() | |
assert "Engine's sound." == car.run() | |
assert "Engine's sound." == car._start_engine() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment