Check if the Same Case

Published by Helen Yu in

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

Watch a quick demo on how Edabit works.