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))






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论