
Boss
Final Boss: Launch the Lantern Network

Boss Fight!
Every passing test breaks a shield.
This is it, apprentice. Every island has sent its repair list, and the Guild Council has gathered at the great lighthouse. The model, the storage and the command parser are ready (they're in your starter code). Now wire them into one app and light the whole network.
After this boss, one last lesson waits: a project you design yourself.
Assignment
Complete LanternNetwork. Its store is loaded from path in __init__.
execute(line): parse the command, run it, and return a reply. Save the store after every change.- add:
"added #1: Fix the bridge [Ember, p1]" - done:
"lit #1: Fix the bridge" - list:
self.list_tasks(island) - report:
self.report()
- add:
list_tasks(island=None): one line per task (only that island's tasks, if given), sorted by priority and then id:"#1 [ ] Fix the bridge (Ember, p1)". Use[x]for done tasks. Return"no tasks"if there are none.report(): lines joined with"\n":
Islands are sorted A to Z, and the percentage isLantern Network report Ember: 1/2 lit Frost: 0/1 lit Total: 1/3 lit (33%)round(100 * lit / total)(use0%when there are no tasks). If there is at least one task and every task is done, add a last line:All lanterns lit! The network is online.run(lines): return the replies for every line. If a line raisesValueErrororKeyError, its reply is"error: <message>"(useerr.args[0]), and processing continues.
Complete LanternNetwork. Its store is loaded from path in __init__.
execute(line): parse the command, run it, and return a reply. Save the store after every change.- add:
"added #1: Fix the bridge [Ember, p1]" - done:
"lit #1: Fix the bridge" - list:
self.list_tasks(island) - report:
self.report()
- add:
list_tasks(island=None): one line per task (only that island's tasks, if given), sorted by priority and then id:"#1 [ ] Fix the bridge (Ember, p1)". Use[x]for done tasks. Return"no tasks"if there are none.report(): lines joined with"\n":
Islands are sorted A to Z, and the percentage isLantern Network report Ember: 1/2 lit Frost: 0/1 lit Total: 1/3 lit (33%)round(100 * lit / total)(use0%when there are no tasks). If there is at least one task and every task is done, add a last line:All lanterns lit! The network is online.run(lines): return the replies for every line. If a line raisesValueErrororKeyError, its reply is"error: <message>"(useerr.args[0]), and processing continues.
main.py Python sleeping
Press Run to try your code, then Check to test it.