things=[("red",1),("red",2),("green",5),("green",10),("red",15)]
for key,value in groupby(things,lambda x:x[0]):
for thi in value:
if(b==key):
print("things present in:",thi[1])
things=[("red",1),("red",2),("green",5),("green",10),("red",15)]
for key,value in groupby(things,lambda x:x[0]):
for thi in value:
if b.casefold() == key.casefold():
print("things present in: ", thi[1])
只需在字符串中添加
casefold
。你知道吗相关问题 更多 >
编程相关推荐