class ren(object): '''this class is about ren class。类的说明,使用三个单引号''' name='菇凉' sex='Female' def hello(self): print('hello world') a=ren() print(type(a)) print(a.name) print(a.sex) a.hello() a.name='未来啊' print(a.name)
返回结果:
<class '__main__.ren'>
菇凉
Female
hello world
未来啊