萌新问一下Python3 一直报to short
查看原帖
萌新问一下Python3 一直报to short
476045
a419432571楼主2021/1/25 13:03

萌新问一下Python3 一直报to short if name=='main':

n=int(input())
x=[]
for i in range(n):
    x.append(input())
t=input()
res=[]
for i in x:
    if len(i)>=len(t) and i[:len(t)]==t:
        res.append(i)
res=sorted(res)
for i in res:
    print(i)
2021/1/25 13:03
加载中...