A complex number is a number of the form
The sum of two complex numbers
We represent a complex number as a tuple
of two numeric values. Write a function sum
that calculates the sum of two complex numbers.11
>>> sum((3, 4), (7, 2))
(13, 34)
Actually, Python supports a separate data type complex
that
represents complex numbers, so there is not really a need to deal
with complex numbers as tuples, but for the purpose of practicing
with tuples this exercise works fine. ↩2