Files
30-seconds-of-code/snippets/is_lower_case.md
Rohit Tanwar 55f39b14bd new snippets
2018-02-01 13:49:59 +05:30

322 B

is_lower_case

Checks if a string is lower case.

Convert the given string to lower case, using str.lower() method and compare it to the original.

def is_lower_case(str):
    return str == str.lower()
is_lower_case('abc') # True
is_lower_case('a3@$') # True
is_lower_case('Ab4') # False