Polar Coordinates - Solution Python

Author: Al-mamun Sarkar Date: 2020-03-26 08:48:05

Polar Coordinates problem solution in Python. The following code is the solution of the HackerRank Polar Coordinates Python Math problem.

Code:

import cmath

input = complex( input() )

print( abs(input) )
print( cmath.phase(input) )

 

Test Input:

  1+2j

Test Output:

 2.23606797749979 
 1.1071487177940904