Python – Find values Close to Each Other – isclose() Function with Examples

isclose() function is used to find the True if the values a and b are close to each other and False otherwise in Python for the given input(x – parameter).

 

Syntax of isclose() Function

The syntax of isclose() function in Python is:

 

Parameters of isclose() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, isclose() function will return an Error.

 

Compatibility

isclose() function is available and compatible with Python 3.5 and above versions. This function is a part of python standard math library.

 

Return Value of isclose() Function in Python

isclose() function returns True if the values a and b are close to each other and False otherwise for the given input.

 

Python isclose() Function Example


Output: