摘要:a= 'eeekkksksksk' print a.replace('e','s').replace('s','k') #kkkkkkkkkkkk change={"e":"s","k":'@',"s":"!"} a_new=''.join(change[i] for i in a) print(a_new) ''' sss@@@!@!@!@ ''
阅读全文
摘要:#!/usr/bin/python a=set([i for i in range(4,8)]) b=set([i for i in range(5,12)]) c= sorted(a & b) print c print reduce(lambda x,y:(x-1)*y,c) def func_1(x,y): return (x-1)*y print reduce(func_...
阅读全文
摘要:#!/usr/bin/python import re def readfa(l): col={} arr =[] sca ='' li = open(l) for line in li: if re.match(r'>(\w*)',line): match = re.match(r'>(\w*)',line) ...
阅读全文
摘要:1 a = "please" 2 b = "say something:" 3 c =a+b 4 m = 0 5 a = True 6 while a: 7 m = int(raw_input(c)) 8 print m+1 9 if m>11: 10 a = False 11 12 #please say something:wwww...
阅读全文
摘要:1 name = ['alle','mike','tom','jerry','alice','hebe'] 2 for i in name: 3 if i == 'tom': 4 print 'get!' 5 #get! 6 7 if 'ale'not in name :print 'get!' 8 9 #get! 10 a = 'tom' 11 ...
阅读全文