這裏討論了兩件事情:函數
1.math模塊的sqrt函數沒法處理負數的狀況blog
2.導入模塊的時候,導入方式的區別:import
from cmath import sqrt就沒法再用math裏的sqrt!im
而import cmath的話,就仍是能夠有sqrt(4)等於2,這樣子的使用~d3