Trusted answers to developer questions

Eman Kashif

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** math** module in Python provides access to mathematical functions and constants.

`math.isnan()`

Suppose you want to validate records that specify the trends in inflation. `math.isnan()`

will be used to check if the values entered are numbers or not. This mechanism is used largely in validating systems.

```
math.isnan(x)
```

`x`

: The value to be checked.

This parameter is required.

The function returns a `Boolean`

value of `true`

if the value is not a number, and `false`

if it is a number.

#import libraryimport math#initialize variablesa = 3b = -5.6c = math.infd = 9932.435e = +57f = 0.00004g = math.nan#Check whether variables are NaNprint(a, ':', math.isnan(a))print(b, ':', math.isnan(b))print(c, ':', math.isnan(c))print(d, ':', math.isnan(d))print(e, ':', math.isnan(e))print(f, ':', math.isnan(f))print(g, ':', math.isnan(g))

RELATED TAGS

python

math

nan

notanumber

communitycreator

CONTRIBUTOR

Eman Kashif

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses