This class assumes some prior knowledge of Python In the following questions

This class assumes some prior knowledge of python in

This preview shows page 2 - 4 out of 6 pages.

This class assumes some prior knowledge of Python. In the following questions, you will need to work with basic (standard library) data types (floats, lists, dictionaries, etc.) and control flow (conditionals, loops, functions, etc). If the questions in this section are totally unfamiliar to you, you may need revisit some practice materials to catch up with some of the programming. Through these questions, we will also prompt you to use a couple slightly more advanced standard library functions (for example, ‘enumerate’ and ‘zip’), that may be new to you. Each question should be answerable with a relatively small number of lines of code, up to about 5-7 lines at most. If you are having any trouble, remember to visit the course tutorials ( ). Assignment questions often follow the structure of examples provided in the tutorials, and a large number of relevant links and external materials are also indexed in the tutorials. 1.3.1 How to complete assignments Whenever you see: YOUR CODE HERE raise NotImplementedError () You need to replace this section with some code that answers the questions and meets the specified criteria. Make sure you remove the ‘raise’ line when you do this (or your notebook will raise an error, regardless of any other code, and thus fail the grading tests). Recall that any cell with one or more assert statements in it is a test cell. You should not try to change or delete these cells. Note that there might be more than one assert for each question. If a test does fail, read the error that is printed out. The error should let you know which test failed, which may be useful for debugging. [4]: # PRINTING VARIABLES # A reminder that you can (and should) print and check variables as you go. 2
Image of page 2
# This allows you to check what values they hold, and debug if anything , unexpected happens. # Define a variable math_result = 2 * 4 # Print out the value(s) of a variable. print (math_result) 8
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 6 pages?

  • Fall '17

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture