The cmath(complex math) module in the standard library provides mathematical functions for working with complex numbers. The cos() function in this module is used to find the cosine of a given complex number.

Syntax:
cmath.cos(x)
x The angle in radians(real or complex) whose cosine should be calculated
Parameters:

The function returns a complex value representing the cosine of the input value, .

ExampleEdit & Run
import cmath

print(cmath.cos(1.5))
print(cmath.cos(2.1))
print(cmath.cos(4 + 0j))
print(cmath.cos(2 -0.25j))
Output:
(0.0707372016677029-0j)(-0.5048461045998576-0j)(-0.6536436208636119+0j)(-0.4292192986881662+0.22969972965814137j)[Finished in 0.01079884497448802s]