Category: Projects

  • Simple Website

    A basic website built with Flask, a Python web framework. When you open it in the browser, it shows a message. You can expand it into blogs, portfolios, or web apps.

    • Basics of web frameworks.
    • Creating routes (URLs) and responses.
    • Running your own web server.
    • This introduces you to web development with Python.
    from flask import Flask
    
    app = Flask(__name__)
    
    @app.route("/")
    def home():
    
    return "Hello, this is my first Flask website!"
    if __name__ == "__main__":
    app.run(debug=True)
  • Weather App (using API)

    This project fetches real-time weather data from the internet (using the OpenWeatherMap API). You type a city, and it shows the current temperature and conditions.

    • Using APIs (connecting your program to online services).
    • Sending HTTP requests with the requests library.
    • Handling JSON data in Python.
      This teaches you how Python interacts with the web.
    import requests
    
    city = input("Enter city name: ")
    api_key = "your_api_key_here"  # get free key from openweathermap.org
    url = f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric"
    
    response = requests.get(url).json()
    print(f"Weather in {city}: {response['main']['temp']}°C, {response['weather'][0]['description']}")
    
  • Password Generator

    Generates random strong passwords A tool that generates strong random passwords using letters, numbers, and symbols. You can choose the password length.

    Security basics (importance of strong passwords).
    It’s practical—you can actually use this in real life.

    Using libraries (string, random).

    Working with lists and strings.

    import random
    import string
    
    def generate_password(length=10):
    
    characters = string.ascii_letters + string.digits + string.punctuation
    password = "".join(random.choice(characters) for i in range(length))
    return password
    print("Generated password:", generate_password(12))
  • Calculator App

    Simple Calculator

    • Create a command-line calculator where users can input mathematical operations (addition, subtraction, multiplication, division), and the program will compute the result
    • A simple program that performs addition, subtraction, multiplication, and division.

      def calculator(): num1 = float(input("Enter first number: ")) op = input("Enter operator (+, -, *, /): ") num2 = float(input("Enter second number: ")) if op == '+': print("Result:", num1 + num2) elif op == '-': print("Result:", num1 - num2) elif op == '*': print("Result:", num1 * num2) elif op == '/': print("Result:", num1 / num2) else: print("Invalid operator!") calculator()

    1. To-Do List
      • Build a to-do list program where users can add tasks, mark them as complete, and delete them. You can store tasks in a file or in memory.
    2. Basic Alarm Clock
      • Build a simple alarm clock where the user can set a time, and the program will notify them once the time is reached.
    3. Currency Converter
      • Create a currency converter that uses exchange rates from an API (like ExchangeRate-API) to convert one currency to another.

  • Web Scraper

    1. Create a web scraper using libraries like BeautifulSoup or Scrapy to collect data from websites. For example, you can scrape news headlines or product prices and store them in a database.

    import requests
    from bs4 import BeautifulSoup

    def web_scraper():
    url = “https://quotes.toscrape.com/”
    response = requests.get(url)

    soup = BeautifulSoup(response.text, 'html.parser')
    
    quotes = soup.find_all("span", class_="text")
    authors = soup.find_all("small", class_="author")
    
    print("Quotes and Authors:")
    for quote, author in zip(quotes, authors):
    
    print(f"Quote: {quote.get_text()}")
    print(f"Author: {author.get_text()}")
    print("-" * 50)</code></pre>

    Run the scraper

    web_scraper()

    1. Personal Finance Dashboard
      • Build a web-based personal finance dashboard that pulls in transaction data from APIs (like PayPal or bank APIs) and displays them in graphical formats using libraries like Plotly or Matplotlib.
    2. Django/Flask Blog App
      • Build a blogging platform where users can create accounts, post articles, comment on posts, and like articles. This can be a full-stack project using Django or Flask for the backend and a simple HTML/CSS/JS front end.
    3. AI-based Sentiment Analysis
      • Create a sentiment analysis tool that uses machine learning to analyze text and predict whether the sentiment is positive, negative, or neutral. You can use libraries like TextBlob or NLTK for this project.
    4. Social Media Automation
      • Build a bot that can automate tasks on social media platforms (like Twitter or Instagram) using their respective APIs. The bot could post updates, follow users, or respond to comments.
  • Number Guessing Game

    Build a simple number guessing game where the program randomly selects a number, and the player has to guess it. You can provide hints like “too high” or “too low.”

      import random

      def number_guessing_game():
      print(“Welcome to the Number Guessing Game!”)
      print(“I am thinking of a number between 1 and 100.”)

      # Generate a random number between 1 and 100
      number_to_guess = random.randint(1, 100)
      
      attempts = 0
      guessed = False
      
      while not guessed:
      
      guess = int(input("Make a guess: "))
      attempts += 1
      if guess &lt; number_to_guess:
          print("Too low. Try again!")
      elif guess &gt; number_to_guess:
          print("Too high. Try again!")
      else:
          print(f"Congratulations! You guessed the number in {attempts} attempts.")
          guessed = True</code></pre>