Knock the clock Python

Accepted code:

n = int(input())

for i in range(n):
    line = input()
    if line.find("ong,") == -1 or line.find("ong.") == -1: #对每一行诗句,判断其是否压“ong”韵。即上下两句末尾的字都是“ong”结尾
        print("Skipped")
        continue
    line = line.split()
    for word in line[0:len(line)-3]:#只输出诗句前面部分
        print (word,end=" ")
    print("qiao ben zhong.")#糟改最后三个词为敲笨钟
    


Guess you like

Origin blog.csdn.net/weixin_56336619/article/details/115211774