Swap Shifts and Unpack Marks
Python
25 pts
Swap Shifts and Unpack Marks
- Selam and Abel want to change shifts. Swap
morningandeveningin one line, without a third variable. - Unpack the list
marksinto three variables:low,middleandhigh. - Create
total=low + middle + high. - Print
morningandeveningon one line, thentotal.
Expected output:
Abel Selam 255
Checklist
- Swap
morningandeveningin one line, without a third variable. - Unpack
marksintolow,middleandhighwithout changing the list. - Create
total, the sum of the three marks. - Print
morningandeveningon one line, thentotal.
🔑 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.
