python打印乘法口诀,敏感字替换

for i in range(1,10):
    for j in range(1,i+1):
        print("%s*%s=%-5s"%(j,i,i*j),end="")
    print("")

敏感字替换

li=['星星点灯','好好','天好美']
stri = "星星点灯时加无可奈,何好好无可奈何天好美眄零配件"

for word in li:
    if word in stri:
        stri = stri.replace(word,len(word)*'*')
print(stri)
posted @ 2020-03-24 18:01  狂舞青春  阅读(261)  评论(0编辑  收藏  举报