开发者社区> 问答> 正文

python必备内置函数- dir()

python必备内置函数- dir()

展开
收起
请回答1024 2020-03-30 11:20:03 409 0
1 条回答
写回答
取消 提交回答
  • 不带参数时返回当前范围内的变量,方法和定义的类型列表;带参数时返回参数的属性,方法列表。

    In [96]: dir(xiaoming) Out[96]: ['class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref',

    'name']

    2020-03-30 11:20:57
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载