ExamVeda
Login
Home
Data Types and Numeric Types
?

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.
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Sayantika Saha
Sayantika Saha 7 months ago
so it will be 4 ri8