In Python, we can check strings if we they contain few characters. These characters can include numbers, lower case, upper case, both numbers and alphabets. To achieve this, we use:
(1) Check if the string contain numbers
This function lets us to check if a string contains numbers.
Because the string 'ABC123' has numbers, which are 123, this function returns us with a boolean operator called, 'True' conveying that there are numbers in the string.
(2) Check for lower or upper case alphabets
In the same way, we can check if all the characters in the string are upper or lower case.
(3) Check if all the characters in the string are alphabets
Using string.isalpha() to check if the string contains all alphabets and we can use string.isalnum() to check if the string contains a combination of letters and numbers.