Suffix Check
Checking the ending of a string is useful for suffixes, file extensions, and short text rules. Write a function ends_ly that takes a string s and returns True if it ends with ly. In all other cases, return False.
Примеры
Ввод
"oddly"Вывод
TrueВвод
"y"Вывод
FalseВвод
"oddy"Вывод
FalseНужно реализовать
def ends_ly(s: str) -> bool:
Теги
strings
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
InloggenVisible tests
1
Input
"oddly"Expected
True2
Input
"y"Expected
False3
Input
"oddy"Expected
False4
Input
"ly"Expected
True5
Input
""Expected
False6
Input
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Expected
FalseFocus radio
Paused · SomaFM · Fluid