我有一个字符串:
myStr = "Chicago Blackhawks vs. New York Rangers"
我还有一个清单:
myList = ["Toronto Maple Leafs", "New York Rangers"]
使用 endswith() 方法,我想编写一个 if 语句来检查 myString 是否以 myList 中的任一字符串结尾。我有基本的 if 语句,但我对应该在括号中放入什么来检查这一点感到困惑。
if myStr.endswith():
print("Success")