Level 1: Object‐Oriented Programming - IncrediCoders/Python1 GitHub Wiki

GitHubAvatarPoint

Grafika Turtle added this page on March 14, 2025


Here is a bonus article that will tell you more about Object‐Oriented Programming!

In addition to this bonus article, you can find other bonus articles that teach you the topics I covered in Level 1: Syntax, Troubleshooting & Error Handling, Methods, Turtle Graphics, and Comments.

Learn About Object‐Oriented Programming

Object-Oriented Programming, or OOP, is a way of thinking about and organizing code by using objects. An object is like a real-world thing in your program. It can have information like a name or color and do things like move or speak.

Instead of writing one long list of instructions, OOP helps you group related things together. You can imagine each object as a mini-helper in your program, with its own job.

Why Object-Oriented Programming Matters

OOP makes big programs easier to build and understand. Each object is responsible for its own part, so you don’t get confused trying to manage everything at once.

For example, you’re one student (an object), and so is Paul Python. You each have your own backpack, class schedule, and favorite snack. You’re both students, but you’re still different from each other. That’s how objects work—same kind of thing, but each one is unique.

Python Example

You can think of an object as something in your program that has a name and can do things. Let’s create an object that represents a pet and let it say hello.

Scenario: Paul Python has a pet named Bubbles. He wants Bubbles to say hello.

class Pet:
    def __init__(self, name):
        self.name = name

    def say_hello(self):
        print("Hi, I'm " + self.name + "!")

# Create the pet object
bubbles = Pet("Bubbles")
bubbles.say_hello()

This will print: Hi, I'm Bubbles!

In this example:

  • Pet is the object type.
  • Bubbles is the object.
  • say_hello is something the object can do.

This shows how Object-Oriented Programming helps group things together—Bubbles knows its own name and how to say hello!

Comparing Programming Languages

Most modern programming languages use Object-Oriented Programming. The way objects are made can look different, but the goal is the same: break your program into smaller parts that do specific jobs.

Imagine a game character who has a name and can jump. Let’s compare how different languages handle that object’s data and action:

Python

class Character:
    def __init__(self, name):
        self.name = name

    def jump(self):
        print(self.name + " jumps!")

Java

public class Character {
    String name;

    public Character(String name) {
        this.name = name;
    }

    public void jump() {
        System.out.println(name + " jumps!");
    }
}

C#

public class Character {
    public string name;

    public Character(string name) {
        this.name = name;
    }

    public void Jump() {
        Console.WriteLine(name + " jumps!");
    }
}

What's the difference?

  • All three languages use OOP to group information and actions into one object.
  • Python uses simpler words like self and doesn’t need to say the type (like string).
  • Java and C# require more structure, but they follow the same idea: keep related things together.

Object-Oriented Programming is like organizing your code into a team of helpers. Each one knows what to do and handles their own job, just like your classmates at IncrediCoders Academy.

Learn More

TBD

Next Steps

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!

Take the Challenges!

  1. 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.

  2. 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.

More Level 1 Resources

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!

Level 2

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

⚠️ **GitHub.com Fallback** ⚠️