What does a function return if there is no return statement?
-
A
0
-
B
None
Correct answer
-
C
0
-
D
An error
10 views
Explanation
If a function has no return statement, it returns None. This is a common source of confusion for beginners.
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ