This is a simple command-line tool to track the total value of a stock portfolio. It was developed as a project for the CodeAlpha Python Programming internship. The user can input their owned stocks and quantities, and the program calculates the total investment value based on a hardcoded set of prices.
The goal is to build a simple stock tracker that calculates the total investment value based on manually defined stock prices and user input. The final portfolio can be optionally saved to a .txt file.
- Allows user to input stock tickers and their quantities.
- Uses a hardcoded dictionary for stock prices (e.g., {"AAPL": 180}).
- Calculates and displays the total portfolio investment value.
- Saves the final portfolio details to a
portfolio.txtfile.
- Clone the repository:
git clone https://github.com/pareshjoshij/CodeAlpha_StockPortfolioTracker.git
- Navigate to the project directory:
cd CodeAlpha_StockPortfolioTracker - Run the Python script:
python stock_tracker.py
This project utilizes several core Python concepts as required by the task:
dictionaryto store stock prices- User
input/outputhandling - Basic arithmetic operations for value calculation
file handlingto save the results