**没想到都抛异常 TypeError: endswith() takes no keyword arguments**
请问是什么原因?
慕后森
浏览 644回答 1
1回答
收到一只叮咚
本来 endswith() 就没有 start 和 end 参数,它的函数原型是这样的
Docstring:
S.endswith(suffix[, start[, end]]) -> bool
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
Type: builtin_function_or_method
只有函数原型是 endswith(suffix, start=0, end=-1) 或者 endswith(suffix, **kwargs) 时,才可以使用 endswith(xx, start=N, end=M) 方式调用。