Python

Python Menu

Python

Python String isnumeric() - Definition, Syntax, Parameters, Examples

Definition

The isnumeric() method returns True if all the characters are numeric (0-9), otherwise False.

Exponents, like ² and ¾ are also considered to be numeric values.

Syntax

string.isnumeric()

Parameters

No Parameters.

Examples:

myStr = "123456" result = myStr.isnumeric() print(result) # other examples c = "10km2" d = "-1" e = "1.5" print(c.isnumeric()) print(d.isnumeric()) print(e.isnumeric())

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods