Latest web development tutorials

Python3 isdecimal () method

Python3 string Python3 string


description

isdecimal () method checks whether the string contains only decimal characters. This method exists only in unicode object.

Note: The definition of a decimal string, just before the string with 'u' prefix can be.

grammar

isdecimal () method syntax:

str.isdecimal()

parameter

  • no

return value

If the string contains only decimal character returns True, otherwise False.

Examples

The following example shows how to use the isdecimal () function:

#!/usr/bin/python3

str = "w3big2016"
print (str.isdecimal())

str = "23443434"
print (str.isdecimal())

Examples of the above output results are as follows:

False
True

Python3 string Python3 string