What is Computer Programming?

Computer Programming is telling the computer what to do. In order for computers to do the cool things they do, a human being has to give them instructions. Computer programming is like giving a set of instructions to a computer in the same way a recipe is a set of instructions for making a cake. These instructions are written in a special language that the computer can understand called code.


Where We'll Write Our Code

Go to Replit. Click Sign Up in the upper right corner


Enter a username, email address, and password to create an account


When you get to these screens, just press Skip


Once you get to the homepage, click Create Repl


Type pygame in the search box and then click on the Pygame template option


Name your repl hello_world and then click Create Repl


Now you'll be taken to the code editor go inside main.py and clear out the sample code. All you should see in that file is the below:


Writing Your Code

Write the following code in main.py:

print('Hello World')

Follow these steps:

  • Type the word print. It starts with a lower-case p instead of an upper-case P. This is important! print() in Python will ALWAYS start with a lower-case p
  • Type the left-parentheses: ( - to type this on the the computer, press and hold the shift key and then press 9.

  • Type the quote character: ' - this key is located to the left of the enter key. to type this on the the computer, simply press it.

  • Type the words Hello World
  • Type the quote character: ' again
  • Type the right-parentheses: ) - to write this on the the computer, press and hold the shift key and then press 0.

**Think of print() as a magic button to print text on the screen, and ( , ' , ' , and ) as special buttons on the keybaord that help the magic print button know what to print on the screen.

Running Your Code

Click on the green Run button at the top of the page


You will then see the output of your code


If you get an error or something different:

  • It's okay! Mistakes happen
  • Go back and make sure you followed the instructions exactly
  • Make the neessary changes to your code and run it again
  • Go back to the File menu and click Save. Then go to the Run menu and click Run Module.


The Coding Sandwich

Think of this print command as a sandwich:

print('Hello World')

In order for the code to run without error, we have to make sure we have a complete sandwich--this means our buns have to match!
In this case, ( , ' , ' , and ) are our buns. If we add a left-parentheses (() to our code, we need a right-parentheses ()) in order to close it. Otherwise, we don't have a bottom bun and our code will error out.

Now try writing the following lines of code and running them. Which lines work and which don't? Can you say why?
  • Print("Hello World")
  • pint("Hello World")
  • print("Hello")
  • print(Hello World")
  • print("Hello World"


Copyright © KX Technology Group, LLC. All Rights Reserved.