2011年9月29日

让python代码更简洁 (2)

摘要: 而是想用python写一个近似于 test?test_true_result:test_false_result的表达式,你可以写test_true_result if test else test_false_result 或者test and test_true_result or test_false_resultand 与 orA and B 表达式取值为第一个值为false的表达式,若全为真,取后一个0 and 5 结果为 01 and 5 结果为 5A or B 表达式取值为第一个值为true的表达式,若全为假,取后一个条件表达式也可写作,注意test_true_result... 阅读全文

posted @ 2011-09-29 11:06 oldcatzzz 阅读(334) 评论(0) 推荐(1)

导航