How to Find Factorial Without Using Loop or Recursion in Python ? #shorts

preview_player
Показать описание
How to Find Factorial Without Using Loop or Recursion in Python ? #shorts
Рекомендации по теме
Комментарии
Автор

from functools import reduce

n = int(input("Enter a number for factorial: "))
ls = [x for x in range(1, n + 1)]
print(reduce(lambda x, y: x * y, ls))

ashutoshpatra
Автор

At first I thought about finding factorial with some new math trick. Lol

Darklegend_royal-metamorphosis
visit shbcf.ru