str.startswith() not working as I intended

前端 未结 5 1196
滥情空心
滥情空心 2021-01-29 11:13

I can\'t see why this won\'t work. I am performing lstrip() on the string being passed to the function, and trying to see if it starts with \"\"\". For some reason, it gets caug

5条回答
  •  再見小時候
    2021-01-29 11:34

    not line_t.startswith('"""') or not line_t.startswith('#')
    

    This expression evaluates to True no matter what string line_t denotes. Do you want 'and' instead of 'or'? Your question isn't clear to me.

提交回复
热议问题