Complex Attributes

complex.real

Extract the component along the real axis as a float. 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.real

Return Value

float

Value obtained by attribute access.

Working Example

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