先将飞字母剔出去放在字典里,排序后在插入回来 a = input() dic = {} for i in range(len(a)) : if not a[i].isalpha(): dic[str(i)] = a[i] for i in a: if not i.isalpha(): a= a.replace(i,'') ls = list(a) b= [3,4,6,9,3,1,2,0] for i in range(1,len(ls)): for j in range(0,len(ls)-i): if ls[j].lower() > ls[j+1].lower(): ls[j],ls[...