Vidyalelo
Python · Q32

Functions in Python

Programming · Python · question 32

Q32

Fill in the line of the following Python code for calculating the factorial of a number. def fact(num): if num == 0: return 1 else: return _____________________

A.
num*fact(num-1)
Answer
B.
(num-1)*(num-2)
C.
num*(num-1)
D.
fact(num)*fact(num-1)

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board