Complex Attributes

complex.imag

Extract the coefficient of j as a float, not a complex number. This is a read-only attribute, accessed without parentheses. Its value has type float for the built-in complex receiver. Assignment is not supported.

Formal Syntax & Structure

python syntaxpython
value.imag

Return Value

float

Value obtained by attribute access.

Working Example

Example Snippetpython
value = 3+4jprint(value.imag)print(type(value.imag).__name__)
Python Reference