← Back to challenges

Check if the Same Case

PythonMediumstringsvalidation

Instructions

Create a function that returns True if an input string contains only uppercase or only lowercase letters.

Examples

same_case("hello") ➞ True

same_case("HELLO") ➞ True

same_case("Hello") ➞ False

same_case("ketcHUp") ➞ False

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Factors of a Given Number