Removing character in list of strings

前端 未结 6 2165
清歌不尽
清歌不尽 2020-12-01 06:51

If I have a list of strings such as:

[(\"aaaa8\"),(\"bb8\"),(\"ccc8\"),(\"ffffdffffd8\")...]

What should I do in order to get rid of all the

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 07:20

    mylist = [("aaaa8"),("bb8"),("ccc8"),("ffffdffffd8")]
    print mylist
    j=0
    for i in mylist:
        mylist[j]=i.rstrip("8")
        j+=1
    print mylist
    

提交回复
热议问题