Created
June 13, 2020 08:43
-
-
Save ZhouYang1993/0c6b387c0d2a5bc37639371ac22c6962 to your computer and use it in GitHub Desktop.
Understand the Property Decorator in Python
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 Student: | |
| def __init__(self): | |
| self._score = 0 | |
| Yang = Student() | |
| print(Yang._score) | |
| # 0 | |
| Yang._score = 100 | |
| del Yang._score |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment