← Back to challenges

Complex Numbers Sum

PythonHardmathstringsnumbersarrays

Instructions

Mubashir needs your help in his maths homework.

Create a function which takes a list of Complex Numbers and returns the sum as a string.

Examples

sum_complex(["2+3i", "3-i"]) ➞ "5+2i"

sum_complex(["1", "1"]) ➞ "2"

sum_complex(["i", "2i", "3i"]) ➞ "6i"

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.