---
title: "Python-内置函数"
author: "mingren135"
date: "2012-10-20T17:33:57Z"
tags: []
categories: ["编程语言"]
slug: "python"
draft: false
lastmod: "2012-10-20T17:39:14Z"
id: 1702247
url: "https://mingren135.iteye.com/blog/1702247"
---

最常用的有2个内置函数，通过它们可以查找需要的方法

 

1）dir：查看object、class上的属性或方法

 

2）help：查看object、class的详细说明

 

其它还有：

 

3）type：查看object类型

 

4）isinstance：判断object是否属于某class

 

5）len：返回object的长度

 

当然还有很多，可以通过sys模块来查看

 

```
import sys
print dir(sys.modules['__builtin__'])
```