Leve 1: Troubleshooting & Error Handling - IncrediCoders/Python1 GitHub Wiki
Grafika Turtle added this page on March 14, 2025
Here is a bonus article that will tell you more about Troubleshooting & Error Handling!
In addition to this bonus article, you can find other bonus articles that teach you the topics I covered in Level 1: Syntax, Object‐Oriented Programming and Comments.
When you write code, things won’t always go perfectly the first time. Just like solving puzzles, coding sometimes means finding and fixing mistakes. This is called troubleshooting. Sometimes the mistake is called an error, and the computer will usually try to tell you what went wrong.
Mistakes help you learn, and in coding, finding and fixing mistakes in your code helps you understand how things work and why they don’t. Troubleshooting builds your problem-solving muscles, just like figuring out which piece fits right into the puzzle.
Let’s look at this mistake and how we to fix it:
print("Paul Python is going to school!"
When we try to run this code, this will give an error. The problem is that the closing parenthesis )
is missing.
Corrected version:
print("Paul Python is going to school!")
Syntax Error: Something is written the wrong way or using the wrong word.
- Example:
pritn("Hello")
instead ofprint("Hello")
Name Error: You try to use a name that hasn’t been created yet.
- Example: print(paul) but you forgot to define paul = "Paul Python" first.
Indentation Error: In Python, the spacing matters. Forgetting to indent can cause an error.
- Example:
if True:
print("Hello")
Instead of:
if True:
print("Hello")
Different languages show errors in different ways.
Scenario: While writing a code, we forgot a semicolon.
Python
print("Hello")
Java
System.out.println("Hello")
Java gives an error: “';' expected”
Because in Java, you must end a code with a semicolon :
System.out.println("Hello");
C#
Console.WriteLine("Hello")
C# will also give an error: “';' expected”
Because you must add the semicolon ;
too in C#
Console.WriteLine("Hello");
- Python is more forgiving for beginners. No semicolon
;
needed. - In Java and C#, they expect every detail to be just right. It’s important to read error messages carefully and check your code line by line.
TBD
Next, if you need help completing the Turtle Map project in the book, you can find help at Level 1: Help.
After you complete Level 1 in the book, you can also take on the two extra challenges to add to your Turtle Map program and learn more! When you're done, you can move on to Level 2, the Class Introductions program!
-
Challenge 1: On this page, I show you how to map a different route to our school, the IncrediCoders Academy. This time, we're going to cross the bridge, over the lake.
-
Challenge 2: For this challenge, I'll show you how to create a loop, so that you can have the turtle go back and forth between my house and the school, five times.
In addition to this Bonus Article and the instructions for our Level 1 challenges, we also have Online Articles, a Learning Quiz, an Unplugged Activity, and a Rewards article:
-
Level 1: Online Articles - I made you a list of different web pages I found, which will help you learn more about Turtle Graphics.
-
Level 1: Learning Quiz - I wrote some questions in case you want to quiz yourself about what you learned. Or you can teach others and quiz them! You'll find the answers to the quiz in the Level 1 Solutions folder.
-
Level 1: Unplugged Activity - I wrote this page with more details than what you saw in the book. In this game, you'll have one person act as the Turtle, and one person is the Programmer!
-
Level 1: Rewards - If you completed the Turtle Map project that we talked about in the car, then I set up this page to be your reward. You can see some illustrations of me and learn more about who I am! You'll also find the Turtle Award digital download, to show off your accomplishment!
After you're completely done with Level 1 (did you do the challenges?), then it's time to move on to Level 2! While you read through Level 2 in your book, you can check out the resources from Mrs. Scratcher, as she teaches you how to build the Class Introductions program:
I hope you had fun learning about the concept of Syntax! After all, my brother was named after it!
-- Grafika Turtle