A complex number is of the form
‘a’ and ‘b’ contain Integers OR Floating-Point Values.
Eg: 3 + 5j 10 + 5.5j 0.5 + 0.1j
In the real part if we use an int value then we can specify that either by decimal, octal, binary, or hexadecimal form. But the imaginary part should be specified only by using the decimal form. 1) >>> a=0B11+5j 2) >>> a 3) (3+5j) 4) >>> a=3+0B11j 5) SyntaxError: invalid syntax Even we can perform operations on complex type values. 1) >>> a=10+1.5j 2) >>> b=20+2.5j 3) >>> c=a+b 4) >>> print(c) a + bj
Real Part Imaginary Part j2 = -1 j =
5) (30+4j) 6) >>> type(c) 7)
c = 10.5+3.6j
c.real 10.5 c.imag 3.6
We can use complex types generally in scientific Applications and electrical engineering Applications.