Question 16
A developer has written the following Python function to compute the factorial of a number: def factorial(n):
if n < 0:
return None
elif n == 0 or n == 1:
return 1
else:
result = 1
for i in range(2, n + 1):
result *= i
return result
What is the cyclomatic complexity of this function?
2
3
4
5