Help!!! How to apply my created function to another function

Gregory Ewing greg.ewing at canterbury.ac.nz
Sun Mar 10 17:25:07 EDT 2019


djoyceb at gmail.com wrote:

> def buildVector(v) :
>     print(v[0],v[1],v[2])

If you want to be able to use the result of this function
in another computation, you need to return it, not print it:

def buildVector(v) :
     return (v[0],v[1],v[2])

Similarly with buildRandomVector and vectorMagnitude.

-- 
Greg



More information about the Python-list mailing list