织梦,路虎中国,魏雪漫老公
随机输入一个字符串,把最左边的10个不重复的英文字母(不区分大小写)挑选出来。 如没有10个英文字母,显示信息“not found”
在一行中输入字符串
在一行中输出最左边的10个不重复的英文字母或显示信息“not found"
在这里给出一组输入。例如:
poemp134
在这里给出相应的输出。例如:
not found
在这里给出一组输入。例如:
this is a test example
在这里给出相应的输出。例如:
thisaexmpl
s = input() words = [chr(i) for i in range(65, 91)] + [chr(i) for i in range(96, 123)] result = ''.join([s[i] if s[i] in words else '' for i in range(len(s)) if s[i].upper() not in s[:i] and s[i].lower() not in s[:i]]) if len(result) > 9: print(''.join(result[:10])) else: print("not found") # please forgive me, too long that 3rd line.
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
新手学习Python2和Python3中print不同的用法
Python基于os.environ从windows获取环境变量
网友评论