Print (type (c))
# this code can output & lt; The class 'complex' & gt;
Five at the back of the j # but convert into other letters complains
# what this j represents
CodePudding user response:
1 + 5 j this type is useful, represent the imaginary mathematical5 j is the imaginary part, 1 is in front of real component, is 1 + 0 j, but can not be a single j
CodePudding user response:
Say the plural imaginary partCodePudding user response:
J is the name of the variableCodePudding user response:
Short answer: Python c=1 + 5 j j said imaginaryA:
1. To understand basic math knowledge
Reference:
Real number
https://zh.wikipedia.org/wiki/
Number, in addition to the ordinary real number and imaginary number corresponding to the corresponding together called the plural
Plural=real number + imaginary
2. The corresponding Python language, with j said imaginary part
Grammar is:
Real + imag j
Or:
The complex (real, imag)
(3) corresponds to your code:
c=1 + 5 j
Also can be written as:
c=complex (1, 5)
Where j, said of the imaginary part, its value is 5
Appendix:
(1) science information
How to understand the imaginary number and plural? - zhihu
https://www.zhihu.com/question/46877027
(2)
Abstract base class Numbers - Numbers - Python 3.8.6 rc1 document
https://docs.python.org/zh-cn/3.8/library/numbers.html#numbers.Complex
The