New Price List
Python
25 pts
New Price List
A shop in Massawa updates its prices (in Nakfa). Starting from prices = [40, 25, 60, 15, 80], make these changes in order:
- Replace the items at index 1 and 2 with
30and65using one slice. - Increase the last price by
10using+=. - Insert a new price
50at the very beginning.
Print the list and then its length. Expected output:
[50, 40, 30, 65, 15, 90] 6
Checklist
- Keep the list
pricesand replace the items at index 1 and 2 with30and65using one slice. - Increase the last price by
10with+=. - Insert
50at the very beginning. - Print the list and then its length.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
