python复数有什么用_什么叫复数,怎么用,通俗简单点

复数是高中知识,可我没上过高中,编程要用到,我用的python复数是怎么计算的,复数后面的j是什么意思___________________________________________________________________________...

复数是高中知识,可我没上过高中,编程要用到,我用的python复数是怎么计算的,复数后面的j是什么意思______________________________________________________________________________________________a=3b=4c=5.66d=8.0e = complex(c,d)f = complex(float(a),float(b))print("a is type: ",type(a))print("b:",type(b))print("c:",type(c))print("d",type(d))print(("e:"),type(e))print("f:",type(f))print("\n")print(a+b)print(b/a)print(b//a)print(e)print(e+f)______________________________________________________________________________________________上面是代码,下面试运行结果______________________________________________________________________________________________a is type: b: c: d e: f: 1.413427561837455970(5.66+8j)(8.66+12j)

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32

Type "copyright", "credits" or "license()" for more information.

>>> help(complex)

Help on class complex in module builtins:

class complex(object)

| complex(real[, imag]) -> complex number

|

| Create a complex number from a real part and an optional imaginary part.

| This is equivalent to (real + imag*1j) where imag defaults to 0.

|

| Methods defined here:

|

| __abs__(self, /)

省略.....

展开


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部