尝试这个:
lst = [("aaaa8"),("bb8"),("ccc8"),("dddddd8")]print([s.strip('8') for s in lst]) # remove the 8 from the string bordersprint([s.replace('8', '') for s in lst]) # remove all the 8s
欢迎分享,转载请注明来源:内存溢出
尝试这个:
lst = [("aaaa8"),("bb8"),("ccc8"),("dddddd8")]print([s.strip('8') for s in lst]) # remove the 8 from the string bordersprint([s.replace('8', '') for s in lst]) # remove all the 8s
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)