Level 09: two-dimension arrays and lists 0 of 9 activities solved
  1. 1. Rainfall collector Not yet solved
  2. 2. Journey log Not yet solved
  3. 3. Snakes and ladders Not yet solved
  4. 4. Quote of the day Not yet solved
  5. 5. Word game Not yet solved
  6. 6. Grade book Not yet solved
  7. 7. Checkout Not yet solved
  8. 8. Missiles Not yet solved
  9. 9. Noughts and crosses Not yet solved
Next series Assessment point: levels 01-09
Level 09: two-dimension arrays and lists

2. Journey log

Sign in to hand in your solution and get feedback.

# 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()