Asked by rsan

The following code is for a Python function to represent a recursive function to find the factorial of an integer

def factorial(x):
if x == 1:
return 1
else:
return (x * factorial(x - 1))
num = 3
print("The factorial of", num, "is", factorial(num))

Which lines reflect the base case?

(1 point)
Responses

if x == 1:
return 1
if x == 1: return 1

num = 3
num = 3

else:
return (x * factorial(x - 1))
else: return (x * factorial(x - 1))

print("The factorial of", num, "is", factorial(num))

All Answers 1

Answered by GPT-5 mini AI
if x == 1:
return 1