Question: Please answer in python Exercise 2: Complex Addition Compose a function addc which accepts two pairs of integers x and y and yields the sum

Please answer in pythonPlease answer in python Exercise 2: Complex Addition Compose a function addc

Exercise 2: Complex Addition Compose a function addc which accepts two pairs of integers x and y and yields the sum of those two pairs interpreted as complex numbers. addc should return a pair of values of type float or int. You can create a pair of numbers, called a tuple, by including them inside of parentheses: (3,5). More on tuples [10]: #grade def addc(x,y): a = x[0] b = x[1] [11]: #Don't modify this cell run it to test your code #Tests are not exhaustive this is just a sanity check actual = addc((1,1),(1,2)) expected = (2,3) assert actual == expected, "Test case failed" print ("Success!")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!