This Python program calculates the factorial of a non-negative integer. The factorial of a non-negative integer n
, denoted as n!
, is the product of all positive integers less than or equal to n
.
-
Run the
factorial.py
script by executing the following command in your terminal or command prompt: -
You will be prompted to enter a non-negative integer.
-
The program will calculate and display the factorial of the entered number.
- Factorial is not defined for negative numbers. If you enter a negative number, the program will raise a
ValueError
.
[bequbed]
This project is licensed under the MIT License - see the LICENSE file for details.