Assignment 3 Submission
This repository contains two Python scripts that demonstrate the use of functions and Pythonโs built-in modules, as part of Module 4: Functions & Modules in Python.
Filename: Task1.py
This script:
- Defines a function named
factorial
that takes an integer input. - Computes the factorial using either a loop or recursion.
- Returns the calculated factorial.
- Calls the function with a sample value and prints the result.
Enter a number: 5 The factorial of 5 is: 120
Filename: Task2.py
This script:
- Accepts a numeric input from the user.
- Uses Python's
math
module to compute:- Square root of the number
- Natural logarithm (base e)
- Sine of the number (in radians)
- Displays the results with proper formatting.
Enter a number: 25 Square root: 5.0 Natural logarithm: 3.2188758248682006 Sine (in radians): -0.13235175009777303
- โ Python scripts for both Task 1 and Task 2 are included.
- โ Validations and error handling implemented.
- โ
This
README.md
file describes the functionality of the scripts.
This assignment is part of Python course - Module 4: Functions & Modules in Python.
.