A Python application that calculates the total value of a stock portfolio using predefined stock prices. The program validates user input, calculates investment values, displays a portfolio summary, and saves the results to a text file.
- Display available stocks and prices
- Validate stock names entered by the user
- Calculate investment value for multiple stocks
- Display total portfolio value
- Save portfolio summary to a text file
- Modular function-based design
- Python 3
- Dictionaries
- Functions
- Loops
- File Handling
stock-portfolio-tracker/
│── stock_tracker.py
│── portfolio.txt
│── README.md
│── LICENSE
Clone the repository
git clone https://github.com/aditi-1731/stock-portfolio-tracker.gitNavigate to the project
cd stock-portfolio-trackerRun
python stock_tracker.pyAvailable Stocks:
AAPL : $180
TSLA : $250
MSFT : $400
GOOGL : $170
AMZN : $150
Enter the different no. of stock you own: 2
Enter stock name: AAPL
Enter quantity: 3
Investment value: $540
Enter stock name: TSLA
Enter quantity: 2
Investment value: $500
========== Portfolio Summary ==========
Total Invested Value: $1040
=======================================
- Python Programming
- Dictionary Operations
- Functions
- Input Validation
- File Handling
- Clean Code Organization
Aditi Tripathi