Source:
Result:
[work@db-testing-com06-vm3.db01.baidu.com python]$ python if_else.py
#### if-else ####
a: 12 + 8
b: 30
max: 30
#### if-elif-else ####
score: 88
B
#### switch ####
0.5
#### switch II ####
3
================================================================
中文注釋參考:
一個極小的問題。在python代碼中,用了中文注釋,不能被python解釋器理解(python 2.5)。解決方案是:


或者:


代碼詳解參考:
http://blog.csdn.net/Lynn_yan/archive/2010/04/08/5464911.aspx