How to remove brackets from python string?

前端 未结 1 691
闹比i
闹比i 2021-02-13 23:31

I know from the title you might think that this is a duplicate but it\'s not.

for id,row in enumerate(rows):
    columns = row.findall(\"td\")

    teamName = co         


        
相关标签:
1条回答
  • 2021-02-14 00:06

    That looks like you have a string inside a list:

    ["blbal"] 
    

    To get the string just index l = ["blbal"] print(l[0]) -> "blbal".

    If it is a string use str.strip '["blbal"]'.strip("[]") or slicing '["blbal"]'[1:-1] if they are always present.

    0 讨论(0)
提交回复
热议问题