摘要:
#!/usr/bin/python#coding=gb2312x=99;def times(x,y): return x+y;def panduan(dke,dk2): if(dke>dk2): return dke; else: return dk2;def inserters(seq1,seq2): res=[]; for x in seq1: if x not in seq2: res.append(x); return res;def inserters2(seq1,seq2): ... 阅读全文
摘要:
#!/usr/bin/python#coding=gb2312res=[];linx=[];f=open('/root/access.log.2');for line in f.readlines(): line.rstrip(); log_home=line.split(); ip=log_home[0]; date=log_home[3].replace('[',''); point=log_home[5].replace('"',''); path=log_home[6]; offer=log_ho 阅读全文
摘要:
#!/usr/bin/python#coding=gb2312items=['aaa',111, (3.4) ,2.03];tests=[(3.4),112];for key in tests: if key in items: print "yes"; else: print "NO";res=[];for key in items: if key not in tests: res.append(key);print res; 阅读全文
摘要:
#!/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 (b 阅读全文
摘要:
#!/usr/bin/python#coding=gb2312 while True: raply=raw_input('Enter type:'); if raply == 'stop': print('bye'); break; elif not raply.isdigit(): if (raply.isalpha()): print(raply.upper()); else: num=int(raply); print(num **2); 阅读全文