Skip to content

vinay4code/Python_Tutedude_Assignment3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python_Tutedude_Assignment3

Assignment 3 Submission

Assignment 3: Functions & Modules in Python

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.


๐Ÿงฎ Task 1: Calculate Factorial Using a Function

Filename: Task1.py

Description:

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.

Sample Output:

Enter a number: 5 The factorial of 5 is: 120


๐Ÿ“ Task 2: Using the Math Module for Calculations

Filename: Task2.py

Description:

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.

Sample Output:

Enter a number: 25 Square root: 5.0 Natural logarithm: 3.2188758248682006 Sine (in radians): -0.13235175009777303


๐Ÿ“ Submission Checklist:

  • โœ… 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.

๐Ÿ“š Reference:

This assignment is part of Python course - Module 4: Functions & Modules in Python.

.

About

Assignment 3 Submission

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages