When something goes wrong in code, we say that we’ve got a bug. A bug is a problem that needs to be fixed. You wrote this code in the last lesson to display
Hello, world! on the screen.
What if you misspelt
In the editor below, type the code above and
Run it so that the program displays an
error message. Then, using the worksheet you opened, copy the
error message into the middle column in the third row.
Then, try copying the code shown in the left column into the editor below and
Run it too! Copy the last line of any error messages you get into the middle column of the worksheet, and then write the correct version of the code in the right column.
Runeach line of code in the left column of the worksheet.
No errorin the middle and right columns.
#in front of each line of code after you
Runit, so that you don’t get the same error every time!
Below is an example of an error message in code. Remember, you only want the last line:
NameError: name 'primt' is not defined on line 3
Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:
Need some help? Click here to reveal a video walkthrough for this task!