Share
CHALLENGE ACTIVITY 5.5.1: For loop: Printing a list Write an expression to print each price in stock prices. Sample outp…
ReportQuestion
Please briefly explain why you feel this question should be reported .
CHALLENGE ACTIVITY 5.5.1: For loop: Printing a list Write an expression to print each price in stock prices. Sample output with inputs: 34.62 76.30 85.05 $ 34.62 $ 76.30 $ 85.05 1 # NOTE: The following statement converts the input into a list container 2 stock_prices – input().split() 5 4 for “solution goes here”: print(‘s’, price) Run TL
in progress
0
6 months
2023-04-07T05:49:11+00:00
2023-04-07T05:49:11+00:00 1 Answer
0 views
Teacher 0
Answer ( 1 )
Please briefly explain why you feel this answer should be reported .
Here’s the code to print each price in stock_prices list with a dollar sign:
scss
stock_prices = input().split()
for price in stock_prices:
print(‘$’, price)
Sample Output:
ruby
34.62 76.30 85.05
$ 34.62
$ 76.30
$ 85.05