2023-01-10 10:45:45 +00:00
|
|
|
def onlyCaps(s):
|
|
|
|
# NOTE: ch.isupper() -> True if ch is uppercase.
|
2023-01-18 19:02:26 +00:00
|
|
|
return (s if len(s) == 0 or (len(s) == 1 and s.isupper()) else "") if len(s) <= 1 else (s[0] + onlyCaps(s[1:]) if s[0].isupper() else onlyCaps(s[1:]))
|
2023-01-10 10:45:45 +00:00
|
|
|
|