Easy Tutorial
❮ Python Att Dictionary Values Python Os Replace ❯

Python3 isdecimal() Method

Python3 String


Description

The isdecimal() method checks if the string contains only decimal characters.

Syntax

The syntax for the isdecimal() method is:

str.isdecimal()

Parameters

Return Value

Example

The following example demonstrates the use of the isdecimal() function:

#!/usr/bin/python3

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

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

The output of the above example is:

False
True

Python3 String

❮ Python Att Dictionary Values Python Os Replace ❯