搜索
您的当前位置:首页正文

复数运算

来源:二三娱乐
a = complex(2,4)
print a.real, a.imag   #2.0 4.0
b = 3 - 4j
print b.real, b.imag   #3.0 -4.0
print b.conjugate()    #(3+4j)
print abs(b)           #5

import cmath
print cmath.sqrt(-1)  #1j
Top