Cafe Menu Check
Python
25 pts
Cafe Menu Check
A cafe in Keren has this menu: menu = ("tea", "coffee", "juice", "milk", "water").
- Create
middle— a slice with the three middle drinks (coffee, juice, milk). - Create
every_other— every second drink, starting with tea (use a step). - Create
has_juiceandhas_soda— booleans that useinto check for"juice"and"soda". - Print the four variables in that order.
Expected output:
('coffee', 'juice', 'milk')
('tea', 'juice', 'water')
True
False
Checklist
- Keep
menuunchanged and createmiddle, a slice with the three middle drinks. - Create
every_other: every second drink, starting with tea, using a step. - Create
has_juiceandhas_sodawithin. - Print the four variables in that order.
🔑 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.
