What is the output of the following Python code snippet?
class M:
@staticmethod
def mul(a, b): return a * b
print(M.mul(3, 4))
-
A
Error
-
B
None
-
C
0
-
D
12
Correct answer
7 views
Explanation
A staticmethod needs no instance or class.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ