Lab 8 - Debug Challenge

The following code has a number of errors. Your job for this lab is to run the code on your own computer and make any necessary changes so that it runs as intended.

Every time you make a change, leave a comment about what you changed and how. For example, if the code looks like this:

if x > 2
    print("hello")

You could fix it like this:

if x > 2: # added colon to if statement to fix syntax error
    print("hello")

Upload your fixed code to the lab assignment.

Some of the errors are syntax errors; others are logical errors. Feel free to use any resources you like to try to fix the problems.

Hint: If you aren’t sure whether your solution works, you can try using some toy data to check it.

Click here) to download your bad code.