“Let’s learn Different Built-in Functions for String Data Type”-Part II

Sandeshgaikwad
4 min readSep 20, 2023

--

Hello everyone Sandesh here again,in previous article we have seen few built in functions for string data type.

https://medium.com/@sandeshgaikwad14/lets-learn-different-built-in-functions-for-string-data-type-89924bcba4a0

Today we will go ahead to learn some more built in functions.Here are the some built in functions are below that we are going learn.

1]isalnum
2]isalpha
3]isdecimal
4]isdigit
5]islower
6]isnumeric
7]isprintable
8]isspace
9]istitle
10]isupper

1] isalnum

Image source google

Here is the Built in function ‘isalnum’.
The isalnum method returns True if all the characters are alphanumeric, alphabet(a-z) and numbers (0-9).But space, ! # % & ? . are special characters are not allowed as alphanumeric. If we add any special characters in a string it will show False.
syntax
>>>variable.isalnum()

2] isalpha

Image source google

The isalpha method returns True if all the characters are alphabet (a-z).

And returns False in any special characters are there.
space,!, #, % ,&, ?, .
syntax
>>>variable.isalpha()

3]isdecimal

Image source google

The method returns True if all the characters are decimals (0-9).
Again it will print False if any special characters or any number appears.

syntax
>>>variable.isdecimal()

4]isdigit

Return True if the string is a digit string, False otherwise. A string is a digit string if all characters in the string are digits and there is at least one character in the string.

syntax
>>>variable.isdigit()

Image help GeeksforGeeks

5] islower

Image source google

Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and
there is at least one cased character in the string.

syntax
>>>variable.islower()

Image help GeeksforGeeks

6] isnumeric

Return True if the string is a numeric string, False otherwise.A string is numeric if all characters in the string are numeric and there is at
least one character in the string.

syntax
>>>variable.isnumeric()

Image help GeeksforGeeks

7] isprintable

Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in
repr() or if it is empty.

syntax
>>>variable.isprintable()

Image help GeeksforGeeks

7] isspace

Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

syntax
>>>variable.isspace()

Image help GeeksforGeeks

8] istitle

Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only
follow uncased characters and lowercase characters only cased ones.

syntax
>>>variable.istitle()

Image help GeeksforGeeks

9] isupper

Image source google

Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and
there is at least one cased character in the string.

syntax
>>>variable.upper()

--

--