Mathematically, a complex number is a number of the form
* A+Bi* where

`i`

Complex numbers are quite commonly used in electrical
engineering. In that field, however, because the symbol
* i* is used to represent current, they use
the symbol

`j`

`j`

” is treated as an imaginary
number. Python displays complex numbers in parentheses when
they have a nonzero real part.
>>> 5j 5j >>> 1+2.56j (1+2.5600000000000001j) >>> (1+2.56j)*(-1-3.44j) (7.8064-6j)

Unlike Python's other numeric types, complex numbers are
a composite quantity made of two parts: the real part and
the imaginary part, both of which are represented
internally as `float`

values. You can
retrieve the two components using attribute references.
For a complex number

:
`C`

is the real part..real`C`

is the imaginary part as a.imag`C`

`float`

, not as a`complex`

value.

>>> a=(1+2.56j)*(-1-3.44j) >>> a (7.8064-6j) >>> a.real 7.8064 >>> a.imag -6.0

To construct a `complex`

value from two
`float`

values, see Section 20.9, “`complex()`

: Convert to `complex`

type”.