Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Assignments – Tutedude

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.


📌 Assignment 1

Module 2: Basic Python Concepts

Task 1: Perform Basic Mathematical Operations

  • 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

Task 2: Create a Personalized Greeting

  • 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


📌 Assignment 2

Module 3: Control Structures in Python

Task 1: Check if a Number is Even or Odd

  • Takes an integer input from the user.
  • Checks whether the number is even or odd using an if-else statement.
  • Displays the result accordingly.

File: Assignment_2/task_1.py

Task 2: Sum of Integers from 1 to 50 Using a Loop

  • Uses a for loop 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


📌 Assignment 3

Module 4: Functions & Modules in Python

Task 1: Calculate Factorial Using a Function

  • 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

Task 2: Using the Math Module for Calculations

  • Asks the user for a number.
  • Uses the math module 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


📌 Assignment 4

Module 5: Files, Exceptions & Errors in Python

Task 1: Read a File and Handle Errors

  • Reads content from sample.txt line by line using readlines().
  • Displays the content with line numbers.
  • Handles errors gracefully if the file does not exist.

File: Assignment_4/task_1.py

Task 2: Write and Append Data to a File

  • 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


📌 Assignment 5

Module 6: Data Structures & Strings in Python

Task 1: Create a Dictionary of Student Marks

  • 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

Task 2: Demonstrate List Slicing

  • 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


🛠️ How to Run

  1. Clone this repository:
    git clone https://github.com/pradipNP/python-assignments-tutedude.git
    

📺 Reference:
Tutedude Course

About

Daily Python assignments and projects from the Tutedude course.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages