Python‎ > ‎string constants‎ > ‎

string.digits

http://www.adilwaseem.com/

Introduction
Return with the number from 0 to 9.

Syntax
string.digits

Parameters
None

Import module
Importing module is required in the Shell window and the Editor window.

Example
The method returns digital number.
 >>> import string
>>> string.digits
'0123456789'
>>>

The string value is converted to integer through int().
 >>> x=string.digits
>>> int(x)
123456789
>>>

Comments