ProgrammingVery hardJEE Main · CAT placement

What is printed?

What is printed?
print((1 + 2j) * (3 - 1j), abs(3 + 4j), (1 + 2j).conjugate())
  1. A. (5+5j) 5 (1-2j)
  2. B. (5+5j) 5.0 (1-2j)
  3. C. (5-5j) 5.0 (1+3j)
  4. D. (7+5j) 5.0 (1-2j)

Correct answer: B. (5+5j) 5.0 (1-2j)

(1 + 2j)(3 - j) = 3 - j + 6j - 2j**2, and since j**2 is -1 this is 5 + 5j. abs of a complex number gives a float, and the conjugate flips the sign of the imaginary part.

More Python Programming questions

Exams that ask this topic