I have a task to write a function that has an optional output argument.
Let's say I have a function y = fun(a,b)
. From what I understood, depending on whether the user needs the value y
, it will EITHER calculate y
OR draw some diagram.
So I think it means that if user calls my function like this: z = fun(1,2)
, then it calculates y
and returns it, but if he calls it like this: fun(3,4);
, then it won't return anything and draw a diagram instead.
Is there any way to check how my function has been called inside it? If yes, then how?