热线电话:13121318867

登录
2019-07-02 阅读量: 615
如何查看python的属性列表

dir():此函数返回与该对象关联的方法和属性列表。

# Python program showing

# a use of dir() function

import math

rk =[1, 2, 3, 4, 5]

# print methods and attributes of rk

print(dir(rk))

rk =(1, 2, 3, 4, 5)

# print methods and attributes of rk

print(dir(rk))

rk ={1, 2, 3, 4, 5}

print(dir(rk))

print(dir(math))

50.0000
5
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子