Sign in to test your solution.
# Journey log program # ------------------------- # Subprograms # ------------------------- def add_chapter(): book.append([]) def add_story(chapter, entry): book[chapter].append(entry) def output(): log = 1 for chapter in range(1, len(book)): for entry in book[chapter]: print("Log", log, ":", entry) log = log + 1 # ------------------------- # Main program # ------------------------- book = [[]] add_chapter() add_story(1, "I find myself alone on a strange world, unequipped and in danger. I have no memory of how I got here, no sense of a before.") add_story(1, "My Exosuit at least seems to know what it's doing, and I am not dead yet...") add_chapter() add_story(2, "I received a set of mysterious coordinates from an unknown source.") add_story(2, "I followed the signal, and found the wreckage of an abandoned starship.") add_story(2, "There was little to be gained from the wreck, but the distress beacon contained the hailing frequency labelled 'ARTEMIS'.") output()
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.

  Python sandbox

This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.