Aug-11-2017, 02:44 PM
I am writing a simple converter to change a bearing to a polar coordinate. I'm not quite sure what I'm doing wrong, but the code below won't print the value of the conversion before moving to anotherPolar():
def polar(): direction = input("North or South?") angle = input("Angle from N Or S:") secondary = input("East or West?") polarangle = 0 if direction == 'N' or direction == 'North': if secondary == 'E' or secondary == 'East': polarangle = round(90 - float(angle),4) return polarangle elif secondary == 'W' or secondary == 'West': polarangle = round(90 + float(angle),4) return polarangle elif direction == 'S'or direction == 'South': if secondary == 'E' or secondary == 'East': polarangle = round(270 + float(angle),4) return polarangle elif secondary == 'W' or secondary == 'West': polarangle = round(270 - float(angle),4) return polarangle print(polarangle) polar() def anotherPolar(): again = input("Another?:") if again.lower() == "y" or again.lower() == "yes": polar() anotherPolar() elif again.lower() == "n" or again.lower() == "no": print("Goodbye") else: print("Invalid Entry") anotherPolar() anotherPolar()