Coding Interview Challenge: Find the Factorial of a Number [Python]

preview_player
Показать описание
In this video series we will be showing you how to write up the algorithm that can find factorial of a number. This is a coding interview question that comes allot.

#codinginterview #algorithm
Рекомендации по теме
Комментарии
Автор

There is an more easy and faster way. By using recursive search
def factorial(n):
if n == 0: return 1
return n * factorial(n-1)

You have also forget to make a condition when n is equaled to 0 because the outcome of that would be 1

fawazbashiru
welcome to shbcf.ru