Chinaunix

标题: Python的3元运算 [打印本页]

作者: wibrst    时间: 2007-04-06 12:40
标题: Python的3元运算

>>> 9 if 2 else 3
9
>>> 9 if 0 else 3
3


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28253/showart_272074.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2