lines.strip python code example Example: strip() txt = ",,,,,rrttgg.....banana....rrr" x = txt.strip(",.grt") #outputs banana print(x)