Hello FCC campers, well i have question !!

As factorial of 1 equals 1, can we use factorial 1 as base condition instead of factorial 0 ?

initialise some variable with 1

lets say

fact = 1

then your code.

Can you be more clear please xD i didnâ€™t understand !!

num = int(input("Enter a number: "))

factorial = 1

if num < 0:

print(â€śfactorial can not be calclatedâ€ť)

elif num == 0:

print(â€śThe factorial of 0 is 1â€ť)

else:

for i in range(1,num + 1):

factorial = factorial*i

print(â€śThe factorial ofâ€ť,num,â€śisâ€ť,factorial)

Hope this help!!

Yes, you can certainly do that.

Thank you itâ€™s more clear !!!

Thank you for the answer !!

remember that

`factorial(0)`

can be passed

if you use as base case `num === 1`

how do you deal when `num`

is equal to 0?

never just use equality, there are â€śequal or less thanâ€ť and â€śequal or more thanâ€ť that will help prevent bugs

i like the way you explain it, Thank you so much !!