?
What is the result of abs(3 + 4j) ?
Answer & Solution
Correct Answer:
Option
C
In Python, the abs() function returns the magnitude (modulus) of a complex number.
A complex number is written in the form a + bj, where a is the real part and b is the imaginary part.
The magnitude of a complex number is calculated using the formula √(a² + b²).
For the complex number 3 + 4j:
Real part = 3
Imaginary part = 4
Magnitude = √(3² + 4²) = √(9 + 16) = √25 = 5.
Therefore, abs(3 + 4j) returns 5.
Hence, the correct answer is Option C: 5.
A complex number is written in the form a + bj, where a is the real part and b is the imaginary part.
The magnitude of a complex number is calculated using the formula √(a² + b²).
For the complex number 3 + 4j:
Real part = 3
Imaginary part = 4
Magnitude = √(3² + 4²) = √(9 + 16) = √25 = 5.
Therefore, abs(3 + 4j) returns 5.
Hence, the correct answer is Option C: 5.
Join the Discussion
Login to post a comment or share your explanation.
Login