0
import math
'''Parameters to input: NS, EW, degee, minute, second
What the function does: converts bearing to azimuth
Expected return value: azimuth'''
def toAz(v,w,x,y,z):
if v == "W" and w == "S" and x >= 0 and x < 90:
azimuth = x,"deg",y,"min",z,"sec"
if v == "W" and w == "N" and x >= 90 and x < 180:
azimuth = (179-x),"deg",(60-y),"min",(60-z),"sec"
if v == "E" and w == "N" and x >= 180 and x < 270:
azimuth = (180+x),"deg",(y),"min",(z),"sec"
if v == "E" and w == "S" and x >= 270 and x < 360:
azimuth = (270+(89-x)),"deg",(60-y),"min",(60-z),"sec"
return azimuth
提示:如果所有的if子句都是「假」呢? –