0%

Lists · capstone

Capstone project: Project: Build a Small Organizer

You can now create an ordered collection, select and replace its items, grow it, shrink it, search it, it, and copy it deliberately. This project brings the core state-changing choices together in a small organizer.

Your organizer can track books, errands, packing items, goals, recipes, or another subject you care about. You will work with four current items and one completed item. You do not need a . Printing each position explicitly keeps this project inside the ideas you have already learned.

Plan the state changes

Begin with four non-empty . Make the item you will complete different from every item that will remain, so the completed item will no longer appear in the organizer. Then perform these changes in order:

  1. Replace the second item with a more useful version.

  2. Append a fifth item.

  3. Pop the item at 2 into completed_item.

  4. Copy the remaining four items into backup.

The order matters because every change can affect later indexes. Trace the after each step if it does not end up as expected.

Here is a smaller example of planning several changes:

Try it

Make the result readable

A program is easier to use when its output explains itself. Print a heading, the completed item, and each current item with its position:

1. first item

Because loops belong to the next chapter, write four explicit print calls using indexes 0 through 3. This repetition is intentional. It will give you a concrete reason to appreciate loops soon.

Check your own work

Before submitting, confirm that:

  • items contains four non-empty strings after the append and pop;

  • completed_item is not still in items;

  • backup has the same values as items but is a separate list;

  • the output includes a heading, the completed item, and all four current items;

  • your code uses only ideas introduced so far.

This is your first organizer, so keep its subject personal and its structure clear. The fancy filing cabinet can wait.

Task

Build a small organizer by completing the starter program.

Requirements:

  1. Replace the second starting item with a more specific non-empty .

  2. Append a fifth non-empty string.

  3. Pop the item at 2 and store it in completed_item.

  4. Copy the resulting four-item items into backup.

  5. Print the heading My organizer.

  6. Print Completed: ... with the completed item.

  7. Print the four current items as numbered lines using indexes 0 through 3.

You may personalize every item. Do not use a yet.

Choose four non-empty starting strings and keep the completed item different from the remaining items. Once the program runs, use Step in the exercise editor to inspect the list after each change.