- This program asks the user to enter a number.
- It calculates the factorial using a function and prints the result.
- This program asks the user to enter a number.
- It uses the
mathmodule to calculate:- Square root
- Natural logarithm
- Sine (in radians)
Enter a number: 25 Square root: 5.0 Logarithm: 3.2188758248682006 Sine: -0.13235175009777303
- Make sure Python is installed.
- Save the code in
.pyfiles (example:factorial-using-func.py,math-module.py). - Run the files.