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)

猜你喜欢

转载自www.cnblogs.com/young886/p/12560544.html