第三章 7-18 找最长的字符串

n=int(input())
s_list=[]
for i in range(n):
    s=input()
    s_list.append(s)

len_list = list(map(len,s_list))
max_str = s_list[len_list.index(max(len_list))]
print('The longest is: {}'.format(max_str))
发布了80 篇原创文章 · 获赞 6 · 访问量 7623

猜你喜欢

转载自blog.csdn.net/qq_33749437/article/details/104887981