# coding=utf8
__author__ = 'liwei'
'导入type13_1.py模块'
from type13_1 import Hello
h=Hello()
h.hello()
'查看类型'
print(type(Hello))
print(type(h))
print(type(h.hello()))
'使用type()函数创建类,的用法'
print('使用type()函数创建类,的用法')
def fn(self,name='word'):
print('hello %s'%name)
'type函数创建Hello类'
Hello1=type('Hello1',(object),dict(hello=fn))
#有问题
# w=Hello()
# w.hello()
python 学习笔记(十五)
最新推荐文章于 2021-06-28 13:26:25 发布