How to check if the string has only lowercase ASCII letter in Python

1 Answer

0 votes
import string  
     
def check_lowercase_letter(s):  
    for letter in s:  
        if letter not in string.ascii_lowercase:  
            return False
    return True
     

 
s = "python"
print(check_lowercase_letter(s))  
     
s = "Python"
print(check_lowercase_letter(s))  
 



'''
run:

True
False

'''

 



answered May 14, 2019 by avibootz
...