import retry: while True: n = raw_input().lower() l = [] for i in n: if not i.isdigit(): l.append(i); str = '' for i in xrange(len(l)): if l[i]=='a': str+='*~*' else: str+=l[i] print re.sub('\*\*', "", str)except: pass
本文共 385 字,大约阅读时间需要 1 分钟。
import retry: while True: n = raw_input().lower() l = [] for i in n: if not i.isdigit(): l.append(i); str = '' for i in xrange(len(l)): if l[i]=='a': str+='*~*' else: str+=l[i] print re.sub('\*\*', "", str)except: pass
转载于:https://blog.51cto.com/gzmie/1851670