100%(3)3 out of 3 people found this document helpful
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 towork 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 standardlibrary 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 about5-7 lines at most.Ifyouarehavinganytrouble,remembertovisitthecoursetutorials().Assignmentquestionsoftenfollowthestructureof examples provided in the tutorials, and a large number of relevant links and external materialsare also indexed in the tutorials.1.3.1How to complete assignmentsWhenever you see:YOUR CODE HEREraiseNotImplementedError()You need to replace this section with some code that answers the questions and meets the specifiedcriteria. Make sure you remove the ‘raise’ line when you do this (or your notebook will raise anerror, regardless of any other code, and thus fail the grading tests).Recall that any cell with one or moreassertstatements in it is a test cell. You should not try tochange or delete these cells.Note that there might be more than oneassertfor each question.If a test does fail, read the error that is printed out.The error should let you know which testfailed, which may be useful for debugging.[4]:# PRINTING VARIABLES# A reminder that you can (and should) print and check variables as you go.2
#This allows you to check what values they hold, and debug if anything␣,→unexpected happens.# Define a variablemath_result= 2 * 4# Print out the value(s) of a variable.print(math_result)8