#import the cmath module
import cmath

#print the hyperbolic tangent of a radian angle
print(cmath.tanh(0.536j))

The cmath.tanh() function calculates the hyperbolic tangent of a complex number given in radians.

cmath.tanh(x)
x The radian complex angle whose hyperbolic tangent is to be calculated. The value should be numerical value, either real or complex. If the value is a real number, it is first converted into a complex value before the operation.

The function returns a complex number representing the hyperbolic tangent of the input complex value, x

import cmath

print(cmath.tanh(0))
print(cmath.tanh(0.5 + 1j))
print(cmath.tanh(-2j))
print(cmath.tanh(0.23 + 1.24j))