0
Parenthesis
Why in the quiz at return statement there are no parentheses: return y; whereas in the previous sample code there is: return(y); Which one is right? Or both are allowed?
4 Antworten
+ 1
Is this about Python?
return is not a function but a keyword, you don't need parentheses there.
Values separated by comma will be read as a tuple - where you normally have the option not to write (), like: a = 1, 2 or a = (1, 2) which both work.
0
Hi, no it is about C. Sorry that I didn't mentioned.
0
In C you also need no parentheses (you can return only one value anyway).
0
Ok, thank you for your answers.