Python endswith() with multiple string
endswith() accepts a tuple of suffixes. You can either convert your list to a tuple or just use a tuple in the first place instead of list.
In [1]: sample_str = "Chicago Blackhawks vs. New York Rangers"
In [2]: suffixes = ("Toronto Maple Leafs", "New York
原创
2021-08-14 15:16:20 ·
316 阅读 ·
0 评论