Python Projects

Python Projects

1. Prime Number Checker

Project Description: Create a Python program that checks if a given number is a prime number. A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.
Key Concepts:
    1. Loops and conditionals
    2. User input

Output Video

2. Basic ATM Machine Simulation

You are required to create a simple ATM simulation program. The ATM should have the following functionalities:

Deposit: The user can deposit money into their account. The ATM should update the account balance accordingly.
Withdraw: The user can withdraw money from their account. The ATM should check if the account has sufficient funds before processing the withdrawal.
Check Balance: The user can check their current account balance at any time.
Exit: The user can exit the program when they are done.
Instructions.

Create a class called ATM to represent the ATM machine.

The class should have the following methods:

deposit(amount): Adds the specified amount to the account balance.
withdraw(amount): Subtracts the specified amount from the account balance if there are sufficient funds. If not, print a message saying “Insufficient funds.”
check_balance(): Prints the current balance of the account.
Implement a main function that simulates the ATM interface with the following options:

Deposit
Withdraw
Check Balance
Exit

Output Video

3. Basic To-Do List Application

You are required to create a simple To-Do List application using Python that allows users to manage their daily tasks. The application should allow the following operations:
      1. Add Task: The user can add a new task to the to-do list.
      2. Remove Task: The user can remove a task from the list.
      3. View Tasks: The user can view all tasks in the to-do list.
      4. Exit: The user can exit the program when they are done.
Requirements:
      1. Use a list to store the tasks.
      2. Write functions to handle each of the operations:
            ○ add_task(task) to add a task.
            ○ remove_task(task) to remove a task.
            ○ view_tasks() to view all tasks.
      3. The program should display a menu with options to:
            ○ Add a task
            ○ Remove a task
            ○ View all tasks
            ○ Exit the application
      4. After a task is added or removed, display the updated list.
      5. When displaying tasks, show them with a serial number starting from 1.

Output Video

4. Student Management System - Python Project

You need to build a Student Management System using Python that allows users to perform the following operations:
      1. Add a new student: Allow the user to input the student’s ID, name, age, grade, and email.
      2. View all students: Display a list of all students stored in the system, showing their ID, name, age, grade,
          and email.
      3. Update a student’s information: Allow the user to update a student’s details (name, age, grade, email)
          based on the student’s ID.
      4. Delete a student: Allow the user to delete a student record by providing the student’s ID.
      5. Exit: Allow the user to exit the system.
Instructions:
      1. Create a list to store student records. Each student record should be represented as a dictionary with
           keys: ID, Name, Age, Grade, and Email.
      2. Write functions for each of the operations: add, view, update, and delete students.
      3. The program should display a menu with options for the user to select what action they want to perform.
      4. Use input() to take user inputs for the student’s details and print() to display results.

Output Video

5. Simple Interest Calculator

Write a Python program that calculates the simple interest based on the following inputs:
      1. Principal: The initial amount of money.
      2. Rate of Interest: The annual interest rate in percentage.
      3. Time: The time period for which the interest is calculated (in years).
The formula to calculate the simple interest is:
Simple Interest=Principal×Rate×Time100\text{Simple Interest} = \frac{{\text{Principal} \times \text{Rate} \times \text{Time}}}{100}Simple Interest=100Principal×Rate×Time
The program should:
      ● Ask the user to input the principal amount, rate of interest, and time period.
      ● Calculate the simple interest based on the inputs.
      ● Display the result of the calculated simple interest.

Output Video

6. Currency Converter

Objective:
Create a simple currency converter that allows the user to convert between different currencies (e.g., USD, EUR, GBP, etc.).
Requirements:
      1. User Input:
            ○ The user inputs an amount in a given currency (e.g., USD).
      2. Currency Selection:
            ○ The user selects the currency they want to convert to (e.g., EUR).
      3. Conversion:
            ○ The program should show the converted amount based on predefined exchange rates.
            ○ You can hard-code the exchange rates for simplicity.
Hints:
            ● Use a dictionary to store predefined exchange rates for easy retrieval.
            ● Validate user input to ensure the amount entered is a valid number.
            ● Provide clear instructions for selecting currencies to avoid confusion.

Output Video

7. Simple Alarm Clock

Objective:
Create a Python program that functions as a simple alarm clock. The user sets a time for the alarm in 12-hour format, and the program will continuously check the current time until it matches the alarm time. Once the time matches, the program will notify the user with a message.
Instructions:
Create a Python program that behaves as a simple alarm clock. The user should be able to:
       1. Set the alarm time in 12-hour format (with AM/PM).
       2. The program should continuously check the system’s current time until it matches the set alarm time.
       3. Once the alarm time is reached, print a message saying:
                          ○ “Wake up! Your alarm is ringing!”

The Program Should:

1. Ask the user to input:
        ○ The hour for the alarm (between 1 and 12).
        ○ The minutes for the alarm (between 00 and 59).
        ○ AM/PM for the alarm time.
2. Validate Input:
        ○ Ensure that the AM/PM input is valid (only ‘AM’ or ‘PM’ is accepted). If the user enters an invalid value, prompt them to try again.
        ○ Check if the entered time is valid (e.g., hour between 1-12, minutes between 00-59). If not, prompt the user to enter a valid time.
3. Use time.strftime(“%I: %M  %p”) to fetch the system’s current time in 12-hour format with AM/PM.
4. Continuously check the time, but ensure the program does not overload the system:
        ○ Sleep for 30 seconds between each check to avoid excessive CPU usage.
5. Once the alarm time is reached, the program should:
        ○ Print a notification: “Wake up! Your alarm is ringing!”
        ○ Stop running.

Error Handling:

1. Handle unexpected inputs gracefully:
       ○ Ensure the program does not crash if the user enters non-numeric input or invalid values.
2. Re-prompt the user to enter valid input whenever necessary.
Hints:
       ● Use time.sleep(30) to pause the program for 30 seconds between checks.
       ● Use a loop to validate user input and continuously check the current time.
       ● Use try-except blocks to handle non-numeric or invalid input gracefully.

Output Video

8. Simple Event Registration System

Objective:
Develop a system that allows users to register for different events (e.g., workshops, seminars). The system should manage event details and participant data, ensuring proper registration and data persistence.

Skills Involved:
        ● Handling user inputs
        ● Managing and manipulating data structures (e.g., dictionaries, lists)
        ● Basic file handling for data persistence (optional for saving event data)
        ● Looping and conditional logic
        ● Basic validation and error handling

Key Features:

1. Event Creation:
      ● Allow event organizers to create new events.
      ● Capture event details such as:
              ○ Name
              ○ Date
              ○ Location
              ○ Capacity
      ● Maintain a list of participants for each event that gets updated when someone registers.
2. Participant Registration:
      ● Allow participants to register for available events.
      ● Ensure that the capacity of each event is not exceeded.
      ● Collect participant details, including:
              ○ Name
              ○ Email
3. List Events:
      ● Display a list of all upcoming events, showing:
              ○ Event Name
              ○ Date
              ○ Location
              ○ Number of registrations (e.g., 10/50 participants).
4. Generate Participant List:
      ● Generate and display a list of participants for each event.
      ● This feature is useful for check-in purposes during the event.

Hints:
      ● Use dictionaries or lists to store event and participant data.
      ● Implement basic validation to ensure event capacity limits are respected.
      ● Consider using file handling to save event and participant data for persistence (optional).
      ● Use loops and conditional logic to manage registration workflows.

Output Video

9. Multi-Level Quiz Application

Objective:
Create a Python quiz application that allows users to select from three difficulty levels: Easy, Medium, and Hard. Based on the user’s selection, the quiz will present a set of predefined questions. The user will answer each question by typing the number corresponding to their chosen answer. At the end of the quiz, the user will receive feedback about their answers and the total score.

Instructions:
Create a Python program that includes a multiple-choice quiz with three difficulty levels:
        1. Easy
        2. Medium
        3. Hard
Each difficulty level should have at least three questions, and for each question, provide four possible answers. The correct answer for each question should be identified by a number (1, 2, 3, or 4).

The Program Should:

1. Ask the user to select the difficulty level (Easy, Medium, or Hard).
2. Present the appropriate questions based on the selected difficulty level.
3. After each question:
      ○ Check if the user’s answer is correct and provide feedback (Correct/Incorrect).
4. Handle Invalid Input:
      ○ If the user enters an invalid answer (not an integer between 1-4), display a message saying:
               ■ “Invalid input, please enter a number”
               ■ Ask the user to try again.
5. After all questions:
      ○ Display the user’s total score.

Output Video

10. Hangman Game Implementation

Objective:
You are tasked with implementing a simple text-based Hangman game in Python. The game should allow the player to guess letters in a randomly chosen word and track the number of attempts left. Your goal is to modify and enhance the given code to meet the following requirements:

Requirements:

Game Initialization:
        ● A random word should be chosen from a predefined list of words.
        ● The player will be asked to guess one letter at a time.
        ● The game should display the word as a series of underscores (_), where each underscore represents an unknown letter.
Player’s Guessing:
        ● The player should have a limited number of attempts (15).
        ● The game should:
                 ○ Check if the guessed letter is correct and update the word display accordingly.
                 ○ If the player guesses a letter correctly, that letter should be revealed in its correct position(s) in the word.
                 ○ If the player guesses a letter incorrectly, the number of remaining attempts should be reduced by one.
                 ○ Track the guessed letters and inform the player if they have already guessed a particular letter.
Game Over Conditions:
        ● Win Condition: If the player guesses all the letters of the word correctly before running out of attempts, they win.
        ● Lose Condition: If the player runs out of attempts, the game ends, and the correct word should be revealed.
Input Validation:
        ● Ensure that the player enters only valid single letters (A-Z).
        ● If the player enters an invalid input, the game should prompt the player to enter a valid letter.

Requirements:

Modify the provided Hangman game code to include all of the required features mentioned above.
        ● Ensure that the game:
                1. Properly handles user input.
                2. Updates the word display correctly.
                3. Tracks the remaining attempts.
        ● Test the game to make sure it functions as expected.
Hints:
        1. String Manipulation: Use join() to modify and display the word with guessed letters.
        2. Loops: Use loops to continue asking for input until the game ends (either by a win or running out of attempts).
        3. Lists: Maintain a list of guessed letters to check for repeated guesses.

Output Video