案例演示2
#coding=utf-8 # dict={"name":"lisi","age":20,"sex":1,"address":"aa"}; # search_val="aa"; # search_list=[]; # for key,val in dict.items(): # if val == search_val: # search_list.append(key); # print search_list; #======================================= # import string; #str="123213sdjfslkjAFDSFDSFD"; # newList=[]; # for item in str: # if not item.isdigit(): # newList.append(item); # newList="".join(sorted(newList,reverse=True)); # print sorted(newList,key=string.upper); # info=filter(lambda x:not x.isdigit(),list(str)); # info=sorted(info,reverse=False); # print ‘‘.join(info);
原文:https://www.cnblogs.com/zh718594493/p/12153624.html