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

2019-03-10 Thread Gregory Ewing
djoy...@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

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

2019-03-10 Thread DL Neil
Luuk, On 11/03/19 8:02 AM, Luuk wrote: On 10-3-2019 19:30, djoy...@gmail.com wrote: Please see the last line When reading above, i was thinking about this joke: ...> ;) Yes, I had a similar reaction to the wording: why not put *it* first. Having lived and worked in many countries/culture

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

2019-03-10 Thread Luuk
On 10-3-2019 19:30, djoy...@gmail.com wrote: Please see the last line When reading above, i was thinking about this joke: Q: how will you be able to keep a blonde busy for hours? A: get a paper and write see other side on both sides of the paper When I put vectorMagnitude(A), it returns per

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

2019-03-10 Thread DL Neil
Dear Joyce, On 11/03/19 7:30 AM, djoy...@gmail.com wrote: ... A = [ 4, 5, 1] #TASK0 def displayVector(v) : print(v) displayVector(A) ... B = buildRandomVector(A) def vectorMagnitude(v) : tsum = 0 for i in v: tsum = tsum + i**2 x = math.sqrt(tsum)

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

2019-03-10 Thread djoyceb
Please see the last line When I put vectorMagnitude(A), it returns perfectly corrected that means my function create right. But when I try to put vectorMagnitude(B) which I was thinking to put new list from buildRandomVector(A),it returns an error. I have been attempting to import buildRandomVe

Configuring the REPL's tab completion

2019-03-10 Thread Chris Angelico
I have absolutely no idea how to do this or even where to go looking, so I'd appreciate a starting pointer :) When you're in the Python REPL (just the basic core one, not IDLE or anything), you can tab-complete global and built-in names, attributes of known objects, etc. But quoted strings work ki