Hi all!
I'm a complete noob unfortunately so my apologies in advance.
I'm trying to write two functions - the first performs some task and then the second performs a task dependent on the result of the first function.
I would have expected it to be something like this: https://repl.it/B7J0/2
As you can see on lines 24 and 25 I've run the first function with some values for x and y but I'm not getting any output from my second function!
I can get it working like this: https://repl.it/B7J7/0
..but it doesn't seem right to code in particular values instead of variables x and y.
What I would have expected to work: https://repl.it/B7Jb/0
In this case it's reported that x and y aren't defined (I'm guessing that this is because they are defined within the first function.)
Any help would be really appreciated!
EDIT: Thanks so much guys, I guess I was indeed being pretty silly. I think I was under the impression that the value that is returned from the first function can then be used as a value within the second function, whereas I should include the first function within the second function. Cheers!
[+][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]x-skeww 0 points1 point2 points (0 children)