Question: 
Write a function to convert polar coordinates to rectangular coordinates.


Model's Code:
def polar_rect(r, theta):
    import math
    x = r * math.cos(theta)
    y = r * math.sin(theta)
    rectangular = (x, y)
    complex_form = complex(x, y)
    return rectangular, complex_form



Sample Correct Code:
import cmath
def polar_rect(x,y):
 cn = complex(x,y)
 cn=cmath.polar(cn)
 cn1 = cmath.rect(2, cmath.pi)
 return (cn,cn1)


Asserts:
assert polar_rect(3,4)==((5.0, 0.9272952180016122), (-2+2.4492935982947064e-16j))
assert polar_rect(4,7)==((8.06225774829855, 1.0516502125483738), (-2+2.4492935982947064e-16j))
assert polar_rect(15,17)==((22.67156809750927, 0.8478169733934057), (-2+2.4492935982947064e-16j))


Tests:
Test 1 of 3: FAIL: AssertionError()

Test 590 of 974: 438/590 (74.23728813559322%): failed