Last active
October 1, 2018 16:02
-
-
Save JackInTaiwan/49f0a7943c5faa5a2c593fc01c4ab9eb to your computer and use it in GitHub Desktop.
python_advanced_private_1
This file contains 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 Animal: | |
blood = True | |
__alive = True | |
print(Animal.blood) | |
# True | |
print(Animal.alive) | |
# Error: AttributeError: type object 'Animal' has no attribute 'alive' | |
print(Animal.__alive) | |
# Error: AttributeError: type object 'Animal' has no attribute '__alive' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment