What does a Python function return if it finishes without executing a return statement?
Correct answer D. None
Explanation
Every Python function returns a value. If execution falls off the end of the body, or a bare return is used, the function returns None. Python does not return the value of the last expression as some languages such as Ruby do, so print(f()) shows None.
Answer checked How we write and check questions
Discussion