In this HakerRank Polar Coordinates problem, we have given a complex number and we need to convert it to the polar coordinates.

HackerRank Polar Coordinates in python problem solution

HackerRank Polar Coordinate solution.

import cmath
c = complex(input())
print(abs(c))
print(cmath.phase(c))

Second Solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
import cmath
z=complex(raw_input())
print '{0:.3f}'.format(cmath.polar(z)[0])
print '{0:.3f}'.format(cmath.polar(z)[1])