Introduction: An Introduction to Computer Programming

This tutorial is for those of you with little to no experience with computer programming that would like to be introduced to the topic. By the end you will have written your very first computer program using the python language! From there you will be able to experiment with the language yourself to see what else you can do!

I recommend that you view this tutorial in PDF format to have a better experience. Some images are cropped in the online view and thus you may miss some information unless you click into each visual.

Supplies

  • Any desktop or laptop computer
  • A Web Browser
  • Internet Access

Step 1: Downloading Python

Go to https://www.python.org/downloads/ and select the download button underneath the text "Download the latest version...".

Locate the download in your browser and open it once its done downloading.

Step 2: Installing Python

Once you have opened/launched the python download the window above should pop up, leave everything as is and select the 'Install Now' option.

A progress bar will appear letting you know how far along the installation is. Feel free to close the window once the installation is complete.

You have just installed the latest version of python on your computer!

Step 3: Downloading an IDE

An IDE is an Interactive Development Environment. IDE's typically provide you with a code editor and other developer tools that will allow you to build and run your programs.

The IDE you will be using today is called PyCharm, head over to https://www.jetbrains.com/pycharm/download/ and select your operating system whether it be Windows, macOS, or Linux.

Then select the download button under the community section. Locate the download in your browser and open it once its done downloading.

Step 4: Installing the IDE

Once you have opened/launched the PyCharm download from your browser the window in the images above should pop up.

Hit next on the welcome page, then choose an install location or leave it as is and hit next again.

Leave the Installation options as is or fill them out according to your preferences, these will not affect you during this tutorial.

On the next page click install and yet another progress bar should appear. Close the window once the installation is finished and open PyCharm.

Now you're ready to create your first project!

Step 5: Creating Your First Project

Once you've opened up PyCharm, select the 'New Project' button to begin the project creation process.

In this window you can select the location and name of your project folder.

Make sure the check box reading "Create a main.py welcome script" is deselected and hit 'Create'.

It's as simple as that!

Step 6: Writing Your First Program

Now that your project is open locate the folder called 'venv' in the projects directory, right click on it and select 'New' -> 'Python File'.

Name the file 'HelloWorld' and hit enter. A code editor should appear with your empty HelloWorld.py file open.

Our goal is to print the text "Hello World" to the console. To accomplish this we will use pythons print statement.

Type the code seen in the image above and save the file.

Nice job! You've just written your first program, now it's time to run your code!

Step 7: Running a Program

To run your program initially you are going to have to right click on the file and select Run 'HelloWorld'.

Once you have done this you will be able to run the program by selecting it in the drop-down menu at the top right of the window and clicking the green play button.

When you run the program the console should appear and the correct text should be printed. Did you get it right?

Step 8: Welcome Program

The goal of this program is to ask the user for their name and then welcome them to PyCharm.

First we'll need to create another python file called 'Welcome', do this the same exact way you did for the HelloWorld program.

To get the users name we will use an input statement and store the result in a variable called 'name'. Then all you have to do is use a print statement to write a welcome message. See the code in the image to understand how the code works.

Now it's time to run the program, refer back to the previous step if you need help with this. Since this program asks for user input, you will have to click into the console and type your name, then hit enter on your keyboard and the welcome message will appear.

Now you know how to get input from a user, what are some other questions you could ask the user?

Step 9: More Python

Thanks for following my Instructable! Now that you know how to create a PyCharm project, create python files, and run your code you can start experimenting with computer programming on your own!

Listed below are some resources that can teach you more about the python language,