Examveda

What is the result of abs(3 + 4j) ?

A. 3

B. 4

C. 5

D. 7

Answer: Option C

Solution (By Examveda Team)

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.

This Question Belongs to Python Program >> Data Types And Numeric Types

Join The Discussion

Comments (1)

  1. Sayantika Saha
    Sayantika Saha:
    6 months ago

    so it will be 4 ri8

Related Questions on Data Types and Numeric Types