# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#Python之对象的属性
#http://python.jobbole.com/82622/


#对象的属性

class bird():
    feather = True
 
class chicken(bird):
    fly = False
    def __init__(self,age):
        self.age = age


summer = chicken(2)
print(bird.__dict__)
print(chicken.__dict__)
print(summer.__dict__)
'''
{'__module__': '__main__', 'feather': True, '__doc__': None}
{'fly': False, '__module__': '__main__', '__doc__': None, '__init__': <function __init__ at 0x02042AB0>}
{'age': 2}
'''

 

无语言基础,自学python所做的各种笔记,欢迎大牛指点.