---
title: "判变量是否为空时的写法"
author: "conjohn668"
date: "2010-09-12T00:20:47Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-09-12T00:22:28Z"
id: 761168
url: "https://conjohn668.iteye.com/blog/761168"
---

```
def foo(b):
      return b and 1 or 0
```