📅  最后修改于: 2022-03-11 14:45:24.672000             🧑  作者: Mango
# calc the magnitude (abs) and the phase of a complex number
from cmath import phase # No need to import abs()
c = 1 + 2j
print(abs(c)) # Should print 2.23606797749979
print(phase(c)) # Should print 1.1071487177940904