imaginary numbers are written with a suffix of "j" or "J" : Complex : Data Type PYTHON TUTORIALS


PYTHON TUTORIALS » Data Type » Complex »

 

imaginary numbers are written with a suffix of "j" or "J"


Complex numbers with a nonzero real component are written as "(real+imagj)", or can be created with the "complex(real, imag)" function.

print 1j * 1J
print 1j * complex(0,1)
print 3+1j*3
print (3+1j)*3
print (1+2j)/(1+1j)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Data Type
» Complex