Update the Stock
Python
25 pts
Update the Stock
A shop in Massawa stores its products in a tuple. Sugar is sold out, and coffee has arrived.
- Remove
"sugar"fromstock(use a list andremove()). - Add
"coffee"at the end by joining with a one-item tuple using+. stockmust be a tuple at the end.- Print
stockand then its length.
Expected output:
('rice', 'flour', 'oil', 'coffee')
4
Checklist
- Remove
"sugar"fromstock. - Add
"coffee"at the end by joining a one-item tuple with+.stockmust be a tuple at the end. - Print
stockand 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.
