📈 Stock Portfolio Tracker

A simple Python-based Stock Portfolio Tracker that allows users to calculate the total value of their stock investments using predefined stock prices. This project demonstrates the use of Python dictionaries, user input, basic arithmetic operations, and optional file handling.


🎯 Project Overview

The Stock Portfolio Tracker helps users keep track of their investments by entering stock names and quantities. The program calculates the total portfolio value based on predefined stock prices stored in a dictionary.


✨ Features

✅ User-friendly command-line interface ✅ Enter stock names and quantities manually ✅ Uses a predefined dictionary for stock prices ✅ Calculates total investment value instantly ✅ Displays a detailed portfolio summary ✅ Option to save the results in a .txt file ✅ Simple and easy-to-understand Python code


🛠️ Technologies Used

  • Python 3
  • Dictionaries
  • User Input / Output
  • Basic Arithmetic Operations
  • File Handling (Optional)

📂 Project Structure

Stock-Portfolio-Tracker/
│
├── stock_portfolio_tracker.py
├── portfolio_report.txt (optional)
└── README.md

🚀 How It Works

  1. Run the Python program.
  2. Enter the stock name.
  3. Enter the quantity of shares owned.
  4. The program retrieves the stock price from the predefined dictionary.
  5. Total investment value is calculated automatically.
  6. Portfolio summary is displayed.
  7. Optionally save the results to a text file.

💡 Sample Stock Prices

stock_prices = {
    "AAPL": 180,
    "TSLA": 250,
    "GOOGL": 140,
    "MSFT": 350
}

📋 Learning Outcomes

Through this project, you can learn:

  • Python Dictionaries
  • Input and Output Handling
  • Conditional Statements
  • Arithmetic Calculations
  • File Handling Basics
  • Problem Solving with Python

🎓 Internship Information

This project was developed as the Task 2: Stock Portfolio Tracker and serves as the 3rd completed task of the CodeAlpha Python Programming Virtual Internship.


👩‍💻 Developed By

Alishba Dilawar


⭐ Acknowledgement

Special thanks to CodeAlpha for providing practical project-based learning opportunities through their Python Programming Virtual Internship Program.


📌 Project Status

✅ Completed Successfully as part of the CodeAlpha Python Programming Virtual Internship.

Built With

Share this project:

Updates