24.5k views
2 votes
Write an expression to print each price in stock_prices. sample output for the given program: $ 34.62 $ 76.30 $ 85.05

1 Answer

2 votes
let's say our variable is:

stock_prices = ['$ 34.62', '$ 76.30', '$ 85.05']

Then using for loop in Python, We can print the output as:

for (i in range(0, len(stock_prices)+1):
print(stock_prices[i])

User Jeryl Cook
by
5.5k points