Ich bin neu in Python also bitte mit mir ertragen. Das Problem ist:komplexe Zahl zu polarer Form in Python
"Schreiben Sie eine Funktion polar (z), um eine komplexe Zahl in ihre polare Form (r, Theta) zu konvertieren. Sie können die Mathatan2 und Math.Hypot Funktionen, aber nicht die cmath-Bibliothek verwenden. "
Ich weiß nicht einmal, wo mit diesem starten, aber bisher habe ich:
import math
def polar(z):
z = a + bj
r = math.hypot(a,b)
theta = math.atan2(b,a)
print "(",r,",",theta,")"
Jede Hilfe tun!