Python class Numbers














































Python class Numbers



In order to differentiate whether a given entity is of numeric data type, the Number library is used. The library numbers is imported prior verifying the data is of numeric type.

The syntax goes like
import numbers
isinstance(x,Number)
The isinstance function used returns True if x is of numeric type of the given number data type, else returns False. 
The code snippet run on python IDLE(v3) is shown



Comments