We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# The solution is very straightforward, given the problem explanation. The input is directly converted into a complex number, then abs() and phase() are executed on that complex number, giving polar coordinates r and phi respectively.fromcmathimportphasez=complex(input())print(abs(z))print(phase(z))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Polar Coordinates
You are viewing a single comment's thread. Return to all comments →