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, /)

省略.....

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值