Assignment Lesson

An assignment lesson is basically a practical programming exercise. Learn supports code execution, so you have to solve and submit the assignment through this very same platform. You can see a real example of an assignment of our Introduction to Python Programming online course, for example: Remove Duplicates.

Understanding the requirements

Each assignment lesson will have a human readable description of what we're expecting you to do.

The assignment lesson also has tests (TDD) that we run to check the execution of your code. You can see those tests in the Tests tab:

image

Tests are really important, as they'll let you make more sense out of the requirements of the exercise. For example, in that exercise you can see a line similar to this one:

self.assertEqual(
    remove_duplicates([1, 1, 1, 1, 1, 3, 4, 5, 5, 5]),  # we expect this, to be equals to:
    [1,3,4,5]                                           # < this
)

In this case we're expecting that, if we pass the list [1, 1, 1, 1, 1, 3, 4, 5, 5, 5] to your remove_duplicates function, you remove all duplicate numbers and return [1,3,4,5].

Once you write your code, you can submit it and see the result of your assignment.

image

If your submission contains errors, you'll see something like this in your screen:

image

image

After all the tests pass, you'll complete the lesson and it'll be marked as done in the left menu:

image