This repository contains my solutions for the Tutedude Python Course Assignments.
Each folder corresponds to a specific assignment module, and inside you’ll find separate tasks with Python scripts.
Module 2: Basic Python Concepts
- Takes two numbers as input from the user.
- Performs the following operations:
- Addition
- Subtraction
- Multiplication
- Division
- Displays the result of each operation clearly on the screen.
File: Assignment_1/task_1.py
- Takes first name and last name as input from the user.
- Concatenates them into a full name.
- Prints a personalized greeting message with the full name.
File: Assignment_1/task_2.py
Module 3: Control Structures in Python
- Takes an integer input from the user.
- Checks whether the number is even or odd using an
if-elsestatement. - Displays the result accordingly.
File: Assignment_2/task_1.py
- Uses a
forloop to iterate over numbers from 1 to 50. - Calculates the sum of all integers in this range.
- Displays the final sum.
File: Assignment_2/task_2.py
Module 4: Functions & Modules in Python
- Defines a function
factorial(n)that calculates the factorial of a number. - Uses a loop or recursion to compute the factorial.
- Returns the result and prints it when called.
File: Assignment_3/task_1.py
- Asks the user for a number.
- Uses the
mathmodule to calculate:- Square root of the number
- Natural logarithm (log base e)
- Sine of the number (in radians)
- Displays the calculated results clearly.
File: Assignment_3/task_2.py
Module 5: Files, Exceptions & Errors in Python
- Reads content from
sample.txtline by line usingreadlines(). - Displays the content with line numbers.
- Handles errors gracefully if the file does not exist.
File: Assignment_4/task_1.py
- Takes user input and writes it to a file
output.txt. - Appends additional user input to the same file.
- Reads and displays the final content of the file.
File: Assignment_4/task_2.py
Module 6: Data Structures & Strings in Python
- Creates a dictionary where student names are keys and marks are values.
- Takes a student's name as input.
- Retrieves and displays the marks if the name exists.
- If not found, displays an appropriate message.
File: Assignment_5/task_1.py
- Creates a list of numbers from 1 to 10.
- Extracts the first five elements.
- Reverses the extracted list (using
.reverse()or slicing). - Prints both the extracted list and the reversed list.
File: Assignment_5/task_2.py
- Clone this repository:
git clone https://github.com/pradipNP/python-assignments-tutedude.git
📺 Reference:
Tutedude Course