Matching Feast

At the animal feast, there is one simple rule: a dish fits a beast if it starts and ends with the same letters as the beast’s name. Write a function feast that takes beast and dish. Return True if both the first and last letters match, otherwise return False.

Примеры

Ввод
"great blue heron", "garlic naan"
Вывод
True
Ввод
"chickadee", "chocolate cake"
Вывод
True
Ввод
"brown bear", "bear claw"
Вывод
False

Нужно реализовать

def feast(beast: str, dish: str) -> bool:

Теги

strings
PostgreSQLv16

Le résultat de l'exécution du code s'affichera ici

Visible tests
1
Input
"great blue heron", "garlic naan"
ExpectedTrue
2
Input
"chickadee", "chocolate cake"
ExpectedTrue
3
Input
"brown bear", "bear claw"
ExpectedFalse
4
Input
"marmot", "mulberry tart"
ExpectedTrue
5
Input
"porcupine", "pie"
ExpectedTrue
6
Input
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "garlic naan"
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid