Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
About Lesson

isdigit():-

            The isdigit() method returns True if all the characters are digits, otherwise False. Exponents, like ², are also considered to be a digit.

Syntax:-                       string.isdigit()

txt = “50800”

x = txt.isdigit()

print(x)

Output

True

a = “u0030” #unicode for 0

b = “u00B2” #unicode for ²

print(a.isdigit())

print(b.isdigit())

Output

True

True

error: Content is protected !!