Skip to main content
isupper-islower-lower-upper-python

Python isupper(), islower(), lower() and upper() methods

This python string tutorial help to learn some string methods(isupper(), islower(), lower() and upper()) with example.These methods are used to check string is uppercase, check string is lowercase, convert string to lowercase and string in uppercase.

String Python methods

We’ll look at the Python functions isupper(), islower(), upper(), and lower(). These are string-handling built-in python methods.

Python isupper()

The isupper() function determines whether or not the argument contains any capital characters. If all of the characters in the string are in upper case, this method returns True; otherwise, False.

Syntax:

string.isupper()

Case 1:

string = 'PYTHONPIP'
Output : True

Case 2:

string= 'Pythonpip'
Output: False

Python islower()

The islower() function determines whether or not the argument contains any lowercase characters. If all of the characters in the string are in lower case, this method returns True; otherwise, False.

Syntax:

string.islower()

Case 1:

string = 'PYTHONPIP'
Output : False

Case 2:

string= 'pythonpip'
Output: True

You can also checkout other python String tutorials:

lower() – Convert python string to lowercase

The lower() function is used to convert any given string into the lowercase string. All capital characters are converted to lowercase. If no uppercase characters are found, the original string is returned.

Syntax :

string.lower()

Case 1:

string= 'PYTHONPIP'
Output: pythonpip

Case 2:

string = 'Pythonpip'
Output : pythonpip

upper() – Convert python string to uppercase

The upper() function is used to convert any given string into the uppercase string. All lowercase characters are converted to uppercase. If no lowercase characters are found, the original string is returned.

Syntax :

string.upper()

Case 1:

string = 'pythonpip'
Output: PYTHONPIP

Case 2:

string = 'Pythonpip'
Output: PYTHONPIP

Leave a Reply

Your email address will not be published. Required fields are marked *