---
title: "整数转换成二进制"
author: "pypy"
date: "2010-05-20T09:25:53Z"
tags: ["Python"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-05-20T09:25:53Z"
id: 670388
url: "https://pypy.iteye.com/blog/670388"
---

```python
>>> bin = lambda n : (n > 0) and (bin(n/2) + str(n%2)) or ''
>>> bin(1)
'1'
>>> bin(20)
'10100'
>>>

```