/
dashytka
/
factorial_calculator
Обзор
Документация
Войти
/
dashytka
/
factorial_calculator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
python
11 строк
315 B
dashytka
create python
21 окт 2025, 12:35
21 окт 2025, 12:35
7d055ef
Код
Авторство
О чём код?
def factorial(n): if n == 0 or n == 1: return 1 else: return n * factorial(n - 1) number = int(input("Enter a non-negative integer: ")) if number < 0: print("Factorial is not defined for negative numbers.") else: print(f"The factorial of {number} is {factorial(number)}.")