how to remove text between [removed] and [removed] using python?

后端 未结 9 765
眼角桃花
眼角桃花 2021-02-04 19:19

how to remove text between using python?

9条回答
  •  半阙折子戏
    2021-02-04 20:18

    If you don't want to import any modules:

    string = ""
    
    string = string.split(' ')
    
    for i, s in enumerate(string):
        if s == '' :
            del string[i]
    
    print ' '.join(string)
    

提交回复
热议问题