Created
July 13, 2012 09:48
-
-
Save 013231/3103973 to your computer and use it in GitHub Desktop.
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 Fruit(object): | |
Apple = 0 | |
Pear = 1 | |
Banana = 2 | |
#________________________________ | |
#/ 其它的一些定義, \ | |
#\ 使Fruit類可以下標訪問. / | |
# -------------------------------- | |
# \ ^__^ | |
# \ (oo)\_______ | |
# (__)\ )\/\ | |
# ||----w | | |
# || || | |
print Fruit['Apple'], Fruit['Banana'] | |
#Output: 0 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment