
Lesson Plan
Syntax Errors and Mystery Melody
See if you can fix all of the syntax errors to reveal the mystery melody!
Level
BeginnerTime
20 minutesWhat is a syntax error and how do I fix it?
When you make a mistake writing code, you might get a syntax error. That means that Python can't understand what you typed.
These error messages can be confusing, but they also give you hints about how to fix mistakes. Here's a quick example where Python is confused because we wrote playnote
(with a lowercase “n”) instead of playNote
(with an uppercase “N”)
on line number 3.
And, here's what the resulting error message looks like.
To fix this error, pay attention to the line number provided in the error message. Remember that Python wants you to type everything exactly the same way. Python gets confused even by small mistakes.
Try It
See if you can fix all of the syntax errors in this project to reveal the mystery melody.
https://tunepad.com/project/29138
Make sure to hit the REMIX button so that your changes are saved.