반응형
Given a string of arbitrary length with any ascii characters. Write a function to determine whether the string contains the whole word "English".
The order of characters is important -- a string "abcEnglishdef" is correct but "abcnEglishsef" is not correct.
Upper or lower case letter does not matter -- "eNglisH" is also correct.
Return value as boolean values, true for the string to contains "English", false for it does not.
Solution:
def get_lower(func):
def wrapper(s):
return func(s.lower())
return wrapper
@get_lower
def sp_eng(sentence):
return "english" in sentence
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
0918. Grasshopper - Array Mean (0) | 2022.09.19 |
---|---|
0917. Largest pair sum in array (0) | 2022.09.17 |
0915. Beginner - Reduce but Grow (0) | 2022.09.15 |
0914. Rock Paper Scissors! (0) | 2022.09.14 |
0913. Take the Derivative (0) | 2022.09.13 |