Fill in the line of the following Python code for calculating the factorial of a number. [code] def fact(num): if num == 0:

Trường Phan

New member
Fill in the line of the following Python code for calculating the factorial of a number.
Code:
def fact(num):
    if num == 0: 
        return 1
    else:
        return _____________________
A. num*fact(num-1)
B. (num-1)*(num-2)
C. num*(num-1)
D. fact(num)*fact(num-1)
 

Tìm kiếm

Back
Top