The islower( ) Function is used to check if all the letters in the String are of lower case.
x = "Hello World" if x.islower(): print("All the letters of the String are in lower case") else: print("Not all the letters of the String are in lower case")
In the above code, we have declared a String 'Hello World'.
So, to check, if all the letters in the String are of lower case, we have used 'islower( )' function.
if x.islower(): print("All the letters of the String are in lower case") else: print("Not all the letters of the String are in lower case")
And in this case, 'H' and 'W' in the String 'Hello World' is in upper case. So, we got the below output.
Similarly, let us look at the next example.
x = "hello world" if x.islower(): print("All the letters of the String are in lower case") else: print("Not all the letters of the String are in lower case")
In the above code, we have declared a String 'hello world'.
Similarly, to check, if all the letters in the String are of lower case, we have used 'islower( )' function.
if x.islower(): print("All the letters of the String are in lower case") else: print("Not all the letters of the String are in lower case")
And in this case, all the letters in the String 'hello world' are in lower case. So, we got the below output.