Python 条件判断的使用

#!/usr/bin/python
#coding=gb2312 

if not 1:
    print('trues');
else:
    print('fuck');

bk='skc';    
if(bk=='skl'):
    print 'NOok';
elif(bk=='skc'):
    print 'OK!';
else:
    print 'fuck';
    
branch={'span':10,'jack':20,'black':30};
print (branch.get('span','Bad'));
print (branch.get('shit','Bad'));
if 'span' in branch:
    print "yes";
else:
    print "NO";
    

 

posted @ 2013-03-04 15:50  墨迹哥's  阅读(219)  评论(0编辑  收藏  举报