Note the plural of two Python Review

Foreword

Although the overall difficulty is not the country two Python, but the requirements are very detailed, and two VFP, Access, two C and C ++ are very similar, because after all, is the basis of the requirements of software development, but if the candidates committed to the future of software development, then there will be very far way to go, so two of this "very detailed" requirements, this sense, not too much. Since the two countries, since it is an exam exam, there is certainly a lot of laws to follow. However, teaching materials and meticulous nature and proficiency is what every candidate can not be sloppy.

About the complex

About the complex, the third chapter in the textbook "Basic Data Types", as a subclass of numeric type occurs, the share devoted only half a page. But as pro forma candidates, this part can not be ignored.
Summarize the point of view, the following conclusions worthy candidates to pay attention to:

  • Python language, the complex can be seen as a real number binary ordered pair (a, b), represents a + bj. Wherein a real part and an imaginary part b is a floating point.

  • Imaginary part by uppercase and lowercase suffixes j can be expressed.

  • When j is 1, 1 can be omitted.

  • The real part and the imaginary part can be obtained with z.real and z.imag.

  • The complex are not directly comparable size.

  • Abs absolute value function is also applicable to negative, the result is a complex modulus.

  • math.sqrt (-2) results in an error ValueError: math domain error, because this is the only truth-seeking function of the number of square root.

  • pow (-2,0.5) reasonable, the result is a complex number (8.659560562354934e-17 + 1.4142135623730951j).

Guess you like

Origin blog.51cto.com/zhuxianzhong/2430513