Tuesday 11 October 2022

Complex number in Python

 A complex number is created from real numbers. Python complex number can be created either using direct assignment statement or by using complex () function.

Complex numbers which are mostly used where we are using two real numbers. For instance, an electric circuit which is defined by voltage(V) and current(C) are used in geometry, scientific calculations and calculus.

Example

Convert the number 3 and imaginary number 5 into a complex number:

x = complex(35)

Then output

(3+5j)



Source : https://www.tutorialspoint.com/complex-numbers-in-python

               https://www.w3schools.com/python/ref_func_complex.asp

No comments:

Post a Comment