Hold many values under one name, count them, pick them out by position, and add new ones.
A list holds several values in order under one name. You write it with square brackets and commas: ["AAPL", "MSFT"]. A watchlist is a list. So is a run of daily closing prices.
I show four things here: len() to count the items, x[0] to pick one out by position, x[-1] to pick from the end, and .append() to add one more.
Python counts positions from zero. The first item sits at position 0, the second at position 1, and the third at position 2. tickers[3] stops the program with an IndexError.
Negative positions count from the end. tickers[-1] is the last item and tickers[-2] is the one before it.
Each return comes from two closes next to each other. Lesson 8 turns a whole list of closes into a list of returns.
Your turn
Make two lists that line up by position: prices = [185.40, 410.20, 128.75] and shares = [10, 4, 20]. Using indexing only, print what the last position in the book is worth.
prices[-1] and shares[-1] both point at position 2, so they describe the same holding. Nothing in Python checks the two lists stay lined up. You keep them in step yourself.