Python 了解 类中方法的方式

1、获取对象的类型,通过 dir(类) eg: a = ‘abc’; print(type(a)); 执行得到类型 str dir(str); 后即可查看str的所有方法名称。 2、获取对象的类型,通过 help(类) eg: a = ‘abc’; print(type(a)); 执行得到类型 str help(str); 后即可查看str的所有方法名称及说明 3、输入类名称+‘.’等待加载支持的
相关文章
相关标签/搜索