Team PUL

Making Pong in Python.

Making Pong In Python

Hey everyone! Today we’re going to learn how to make Pong in Python. This video does a fantastic job of showing you step-by-step how to make this project.

Before you watch the video, we want to highlight a few key things to watch for.

First of all, this video uses Turtle. Turtle is a built-in Python library that lets you make graphics for your program. The video uses Turtle to generate the game itself. Here is an excellent site that will better familiarize yourself with Turtle.

Second, the program uses os. Os is a module that provides functions that help you interact with Python’s operating system. A module contains pre-built Python code that can be imported for use in other programs. In this program, the os module is used to help the balls bounce off the paddles and the borders of the window.

Third, the program uses a while loop. A while loop allows you to repeat sections of code until a specified condition is no longer true. This video uses a while true loop, meaning that the loop will run without a specified condition. Typically, these loops are used with a break statement. Break statements are used to stop the current loop and move on to the next line of code outside the loop.

Fourth, the program uses if statements. If statements are used to tell the computer to run a block of code if a certain statement is true. They are similar to while statements, but they are only run once. If the statement is not true, the program will skip over that block of code.

You can view the finished code here.

If you want to learn more about Python, you can check out w3schools or Tutorials Point.

If you are programming this for yourself, here is the sound file the video uses.