conjugate() complex function in python by R4R Team

- conjugate() is a python complex function which find the conjugate of the given complex number.

Syntax-

complex.conjugate()

Example-

complex number is n=3+2j
then conjugate is 3-2j

complex number is -3-2j
then complex is -3+2j


program-

n=complex(3,2)
print("Complex number is ",n)
print("Conjugate is ",n.conjugate())

n=complex(1,3)
print("Complex number is ",n)
print("Conjugate is ",n.conjugate())

n=complex(0,1)
print("Complex number is ",n)
print("Conjugate is ",n.conjugate())

n=complex(-1,0)
print("Complex number is ",n)
print("Conjugate is ",n.conjugate())


output-

Complex number is (3+2j)
Conjugate is (3-2j)
Complex number is (1+3j)
Conjugate is (1-3j)
Complex number is 1j
Conjugate is -1j
Complex number is (-1+0j)
Conjugate is (-1-0j)


-In this program, we have different complex numbers then for each complex number we find the conjugate of them and print that.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!