Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python String isdecimal() Method


previous next AddThis Social Bookmark Button


Description:

This method checks whether the string consists of only decimal characters. This method are present only on unicode objects.

Note: To define a string as Unicode, one simply prefixes a 'u' to the opening quotation mark of the assignment. Below is the example.

Syntax:

str.isdecimal()

Parameters:

Here is the detail of parameters:

  • NA

Return Value:

It return true if all characters in the string are decimal, false otherwise.

Example:

#!/usr/bin/python


str = u"this2009";  
print str.isdecimal();

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

This will produce following result:

False
True


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names