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.

x The angle in radians(real or complex) whose cosine should be calculated

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

import cmath

print(cmath.cos(4 + 0j))
print(cmath.cos(2 -0.25j))