Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python3 isdecimal() Method

Python3 isdecimal() Method

Python3 Strings Python3 Strings


Description

The isdecimal() method checks whether a string contains only decimal characters.

Syntax

Syntax of the isdecimal() method:


str.isdecimal()

Parameters

Return Value

Example

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

Example

#!/usr/bin/python3

str

=

"runoob2016"

print

(

str

.

isdecimal

(

)

)

str

=

"23443434"

print

(

str

.

isdecimal

(

)

)

The output of the above example is:


False
True

Python3 Strings Python3 Strings