

If any parameters specified, then it will also give an error as a syntax error. The islower() method also does not take any arguments or parameters it checks the given string for lowercase characters and gives the output either true or false.The lower() method is also not applicable to any digital characters or numbers and special symbols as there is nothing to convert into lowercase in special symbols and numbers.It only converts the capital letters into lowercase, and if the string is already in small or lowercase letters, then there will be no change in the output value it returns the same as the original value. The lower() method is applied or applies only to the characters or string.The lower() method does not take any parameters as it converts the string to lowercase, and if the parameters are given, then it will give a syntax error.Print("No the given string is not in lowercase",str_out1)įrom the above example, we can see the output if the given string is in small letters then it gives yes given string is in lowercase that is the value returned by the islower() method is “ true ” and if the given string is in capital letters then it gives no the given string is not in lowercase that is the value returned by the islower() method is “ false ”.įrom the above two methods for lowercase: lower() and islower(), we have to note some points to remember while using these two methods.

Print("Yes the given string is in lowercase",str_out) This function only returns the value in terms of true or false. Let us now take an example to show how the islower() method is used. But it returns the Boolean value that is either true when there are lowercase characters present in the given string or false when no lowercase characters are there in the given string. There are no parameters for this function also. This function is only applicable to the alphabet, not to numbers or special characters. Similarly, it can be even done to check uppercase characters using the isupper() function. If yes, then it returns true else, if there are no lowercase characters, it returns false. In Python, there is another function called islower() This function checks the given string if it has lowercase characters in it. Print("The lowercased characters are:", output_str)įollowing are some examples of python lowercase: Example #1 – islower() method This method does not have any arguments as it only returns the lowercase characters.Įxample: input_str = "THIS IS EDUCBA TRAINING PORTAL" The lower() function, after converting to lowercase, creates another string other than the original string and returns that string. The lower() function is applied to only alphabets because numbers and special characters do not have any upper or lower case. In Python, as we discussed, we have a lower() function for this.
PYTHON CONVERT STRING TO LOWERCASE HOW TO
This article is about how to convert strings of uppercase to lowercase.
