Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use plural in Python

Shulou Source: shulou.com Published: 2022-06-01 13:29:53 09月25日 Update

Most people do not understand the knowledge points of this article "how to use the plural in Python", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use the plural in Python" article.

problem

With regard to the plural type of Python, the error described in the following options is

The imaginary part of A complex number is represented by the suffix "J" or "j".

B for the plural z, you can get the real part of it with z.real

C for the complex z, you can use z.imag to get its real part.

D complex number type represents the complex number in mathematics.

Correct answer: C

First of all, let's make it clear what a complex number is: a complex number is defined in mathematics as a number made up of a real part and an imaginary part, such as a+bj.

Where an and b are real numbers, j is "imaginary unit", the square of j is equal to-1.a, b is called the real part and imaginary part of complex a+bj respectively.

Let's define a complex number in Python: real + imag (the unit of the imaginary part can be j or J)

A = 6 + 0.6J

# output the plural a

Print (a)

# get the real part

Print (a.real)

# get imaginary part

Print (a.imag)

# get the conjugate complex number of the complex number

Print (a.conjugate ())

# Let's define a complex number through the complex function

A = complex (1,2) b = complex (1) c = complex ("1") d = complex ("1q2j") the above is about "how to use the plural in Python", I believe everyone has a certain understanding, I hope the content shared by the editor will be helpful to you, if you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Plural content part real number imaginary number unit mathematics article knowledge article type value function suffix most of which is made up of more steps knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno Huawei Apple macOS