题目描述:对输入字符串检查是否存在非法字符,输出合法字符串(去重)和非法字符串(不去重),对合法字符串循环左移10次,再进行排序输出
在这里插入代码片
temp2 = []
temp3 = []
temp4 = []
temp7=[]
for t in range(100):
x = input()
temp = []
temp5=[]
flag = 0
for i in x:
if (i >= '0' and i <= '9' or i >= 'a' and i <= 'z' or i>='A' and i<='Z'):
flag=1
if flag == 1:
for i in x:
if i not in temp:
temp.append(i)
temp5.append(i)
temp4.append(temp5)
for i in range(10):
x = temp[0]
temp.pop(0)
temp.append(x)
temp2.append(temp)
temp7.append(temp)
if flag == 0:
temp3.append(x)
i