要求
input:
4
aba
baba
aba
xzxb
3
aba
xzxb
ab
output:
2
1
0
简易写法:
str_seq = [input() for s in range(int(input()))] qry_seq = [input() for q in range(int(input()))] print(*(sum(q == s for s in str_seq) for q in qry_seq), sep='\n')
input:
4
aba
baba
aba
xzxb
3
aba
xzxb
ab
output:
2
1
0
简易写法:
str_seq = [input() for s in range(int(input()))] qry_seq = [input() for q in range(int(input()))] print(*(sum(q == s for s in str_seq) for q in qry_seq), sep='\n')
本文标题:python简易写法
本文链接:https://www.haomeiwen.com/subject/cvivfctx.html
网友评论