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.


How to Open the Python Shell on your Chromebook

Click on the IDLE3 icon on the shelf. It's the icon that looks like a penguin.


Then create a new file. You should now have two windows open. drag each one to each end of the screen so that it looks like this:

Write your code in the window on the right.

How to Tell the Computer to Print "Hello World"

Open the Python Shell. Then, From the File menu, choose New File. This will open a new window where we will write our code


Write the following code in the window:

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

From the Run menu, click Run Module, or just press the F5 key


You will then be asked to save the file. Click OK.

Then, type your name in the box and then click Save

The output should look something like:

Hello World
>>>


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 commands and running them. Which commands 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.