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
Logáil isteach chun stair na n-aighneachtaí a fheiceáil
Logáil isteachLogáil isteach chun an Meantóir IS a úsáid
Logáil isteachVisible tests
1
Input
"great blue heron", "garlic naan"Expected
True2
Input
"chickadee", "chocolate cake"Expected
True3
Input
"brown bear", "bear claw"Expected
False4
Input
"marmot", "mulberry tart"Expected
True5
Input
"porcupine", "pie"Expected
True6
Input
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "garlic naan"Expected
FalseFocus radio
Paused · SomaFM · Fluid