海诗网 知识百科 python(python培训班)

python(python培训班)

python, Object是python下的一个函数,具体来说就是object类,属于所有类的父类。简单来说,任何其他类都直接或间接继承object类的属性和方法。

用法是object()

参数:

None

python培训班

参考示例:

演示object()的工作,并输入命令:

# Python 3 code to demonstrate

# working of object()

# declaring the object of class object

obj=object()

# printing its type

print (The type of object class object is:)

print (type(obj))

# printing its attributes

print (The attributes of its class are:)

print (dir(obj))

python培训班

输出结果:

The type of object class object is:

The attributes of its class are:

['__class__ '' __delattr__ '' __dir__ '' __doc__ '' __eq__ '' __format__ '' __getattribute__ '' __hash__ '' __init__ '' __le__ '' __lt__ '' __ne__ '' __new__ '' __reduce__ ''' __reduce_ex__ '

以上是边肖的分享,希望对大家有所帮助。

python,以上就是本文为您收集整理的python最新内容,希望能帮到您!更多相关内容欢迎关注。

本文来自网络,不代表海诗网立场,转载请注明出处:https://www.hallse.com/n/169043.html
      

mysql(mysql安装及配置超详细教程)

发表回复
联系我们
联系我们

在线咨询: QQ交谈

邮箱: 3587015498@qq.com

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们
微信扫一扫关注我们
关注微博
返回顶部