Codewars note - 判定 字符串 首尾

Codewars exercise:

 Solution:

def feast(beast, dish):
    return beast.startswith(dish[0]) & beast.endswith(dish[-1])

 

posted @ 2022-06-28 21:05  大序列  阅读(13)  评论(0编辑  收藏  举报