precourse-test

Welcome!

Welcome to our self-assessment test, designed to verify your programming proficiency in Python for our research master’s program. Through three tailored challenges, you’ll gain valuable insights into your current Python skills level. The questions will dynamically adjust based on your performance. These self-adjusting challenges are presented in Jupyter Notebooks running on Google Colab. Please ensure you have a Google account to run the notebooks. The estimated completion time varies, and you can pause and resume at any point.

Your progress and responses are strictly anonymous and will not be accessible to any program personnel, including teachers, DGS, or staff members. You’ll have sole access to your progress on these challenges. So, it is up to you to solve the challenges by yourself and to be honest with yourself. At the end of these challenges, you’ll receive tailored advice based on your results. We highly recommend you follow this advice before you start the program.

The Structure Of The Challenges

Each notebook file contains an auto-graded challenge. For each challenge, begin by reading the instructions in the first cell. Next, replace the placeholder lines with your Python code in the second cell to solve the challenge:

# YOUR CODE HERE
raise NotImplementedError()

If you do not change these lines, your function will raise a NotImplementedError error.

The third cell can be used to enter the requested values and test your function. The fourth cell will test your solution against a number of test cases. If you solved the challenge correctly, you will see a message like the one below:

Well done! You seem to have solved challenge_1!

Debugging

Even in relatively small Python programs, you will discover that it is easy to make mistakes. To identify the source of the problem is, programmers often add print() statements at strategic places throughout their code, so that they can confirm whether their program actually reaches that location and can inspect the current values of some variables at that point.

Example:

def my_function(a, b):
    print('value of a is', a)
    ...

Please use them often. These prints will not influence the auto-grading mechanism, as it is only based on the final value(s).

Final instruction

Before you start solving any of the challenges, please press Ctrl-Enter (PC) or Command-Enter (Mac) in the very first the cell. It will load the modules needed for testing and auto-grading the challenges. Once done, a number between square brackets will appear in front of the cell, like the one below:

[1]

If successful, the following message will appear below the first cell:

Assertions imported OK
Test cells imported OK

First challenge

Once you have read the instructions above, you are ready to continue to the first challenge:

Challenge 1

Good luck!