May 2017
Intermediate to advanced
280 pages
6h 2m
English
A complex number has both real and imaginary parts, and Python allows you to specify this data type in a very easy and convenient way.
Syntax:
<variable name>=complex(x,y)
OR
<variable name>=x+yj
Here, x is the real part and y is the imaginary part. Here, j plays the role of iota.
It will be clearer with the following screenshot:

Here, we declare two variables to denote complex numbers. One way to achieve is to use complex() method and the other way is to use the standard notation as used in mathematics.
Read now
Unlock full access