Last active
August 29, 2015 14:21
-
-
Save josefdlange/bdea97655d8c56fb2d1c to your computer and use it in GitHub Desktop.
Class Attributes
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 Pet(object): | |
| fur_length = 10 | |
| is_alive = False | |
| def __init__(self, name): | |
| self.name = name | |
| fido = Pet("Fido") | |
| fluffy = Pet("Fluffy") | |
| a1 = fido.is_alive | |
| a2 = fluffy.is_alive | |
| Pet.is_alive = True | |
| b1 = fido.is_alive | |
| b2 = fluffy.is_alive | |
| fluffy.is_alive = False | |
| c1 = fido.is_alive | |
| c2 = fluffy.is_alive | |
| fido.is_alive = False | |
| d1 = fido.is_alive | |
| d2 = fluffy.is_alive | |
| clarence = Peth("Clarence") | |
| e1 = clarence.is_alive | |
| ''' | |
| What are "a1" and "a2"? | |
| What are "b1" and "b2"? | |
| What are "c1" and "c2"? | |
| What are "d1" and "d2"? | |
| What is "e1"? | |
| ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment