3章-18重複しない英字10文字(30点)pythonを出力

2109 ワード

ランダムに文字列を入力し、一番左の10文字の重複しない英字(大文字と小文字を区別しない)を選択します.10文字の英字がない場合は、「not found」というメッセージが表示されます.
≪フォーマットの入力|Input Format|oem_src≫:行に文字列を入力します.
出力フォーマット:行の一番左の10文字の重複しない英字または表示情報「not found」を出力します.
入力サンプル1:ここで入力のセットを与えます.例:
poemp134
出力サンプル1:ここでは、対応する出力が与えられる.例:
not found
入力サンプル2は、ここで入力のセットを与える.例:
This is a test example
出力サンプル2:ここでは、対応する出力が与えられる.例:
Thisaexmpl
s1=input()
s=list()
count=0
for i in s1:
    if i.isalpha() and i.lower() not in s and i.upper() not in s:
        s.append(i)                #      :s=s.append()         
        count=count+1
if count<10:
    print("not found")
else:
    for i in range(0,10):
        print(s[i],end="")