标签:walk cte sub imp input inf import lower nts
b=‘The ADJECTIVE panda walked to the NOUN and then VERB. A nearby NOUN was unaffected by these events.‘
import re
keyword=[‘ADJECTIVE‘,‘NOUN‘,‘VERB‘,‘NOUN‘]
word=‘‘
s=‘‘
for n in range(len(keyword)):
word = keyword[n]
strinfo = re.compile(word)
s = input(‘Enter an ‘+word.lower()+‘:\n‘)
b = strinfo.sub(s,b,count=1)
print(b)
python编程快速上手之第8章实践项目参考答案(8.9.2)
标签:walk cte sub imp input inf import lower nts
原文地址:http://www.cnblogs.com/flying-wyf/p/6701776.html