#NEWLINE# def mag( vec ) : #NEWLINE# #INDENT# ' Function computes and returns the magnitude of a vector' #NEWLINE# mag = sqrt ( ( ( ( vec [ 0 ] ** 2 ) + ( vec [ 1 ] ** 2 ) ) + ( vec [ 2 ] ** 2 ) ) ) #NEWLINE# return mag