What is the simple basic explanation of what the return statement is, how to use it in Python?
And what is the difference between it and the print
state
Difference between "return" and "print" can also be found in the following example:
RETURN:
def bigger(a, b):
if a > b:
return a
elif a
The above code will give correct results for all inputs.
PRINT:
def bigger(a, b):
if a > b:
print a
elif a
NOTE: This will fail for many test cases.
ERROR:
----
FAILURE
: Test case input: 3, 8.
Expected result: 8
FAILURE
: Test case input: 4, 3.
Expected result: 4
FAILURE
: Test case input: 3, 3.
Expected result: 3
You passed 0 out of 3 test cases