ExampleEdit & Run
#import the cmath module
import cmath

# print the tangent of a radian angle
print(cmath.tan(0.5236 + 0j))
copy
Output:
(0.5773519017263813+0j) [Finished in 0.011123932898044586s]

The cmath.tan() function is used to calculate the tangent of a complex angle  given in radians. The angle should be in radians not in degrees.

Syntax:
cmath.tan(x)
copy
x The radian complex angle whose tangent we want. The value can be a real or a complex number. If it is a real number, it is first converted to a complex value before the operation. 
Parameters:

The function returns the tangent of the input argument, x.

ExampleEdit & Run
import cmath

print(cmath.tan(0))
print(cmath.tan(0.15))
print(cmath.tan(1 + 2j))
print(cmath.tan(0.1 + 0.2j))
copy
Output:
0j (0.15113521805829508+0j) (0.0338128260798967+1.0147936161466335j) (0.09638813085645422+0.19928415105961048j) [Finished in 0.010406814981251955s]