Introduction

Welcome to Beginning Python course! This course is designed for individuals with no prior programming experience, aiming to introduce you to the fundamentals of Python, one of the most popular and versatile programming languages today.

A programming language is a formal system of instructions used to create computer applications. In other words, it allows humans to communicate with computers by providing a way for writing instructions that can be executed by a machine.

Python is known for its simple syntax, which makes it an excellent choice for beginners. This course is going to show you to give instructions to the computer to perform simple tasks and as you become more confident and follow the later courses, you will find that you are able to write much more complex applications.

Intended learning outcomes

By the end of this course, you will:

  • Understand what a programming language is.
  • Know how to execute instructions, or commands, in Python.
  • Have the skills to create a simple Python script.
  • Feel more confident to embark on your programming journey!

How to read this documentation

In this documentation, any time that we are seeing a small snippet of Python code, we’ll see it written in a grey box like the following:

print("Hello, Python")

If the commands are executed by the machine we will see the output of them below enclosed on a vertical purple line:

print("Hello, Python!")
Hello, Python!

By contrast, you will see larger pices of code as scripts with a given name, e.g. script.py, in a code block with darker header:

script.py
greeting = "Hello"
name = input("What is your name? ")
print(greeting, name)

We may ask you to run a script using the Command Prompt (Windows) or Terminal (Mac and Linux). We will show you what commands to run and will look like this:

Terminal/Command Prompt
python script.py

Please note that sometimes we will skip showing the execution of scripts on the Terminal/Command Prompt box, but we will assume you to run the script on your.

In some cases we will introduce general programming concepts and structures using pseudocode, a high-level, easy-to-read syntax close to natural language. This should not be confused with Python code and cannot be executed on your machine, but it is useful to describe how your code should behave. Here there is an example:

FOR EACH sample IN my_study
    IF (sample.value > 100)
        DO SOMETHING
    OTHERWISE
        DO SOMETHING ELSE

There are some exercices along this course, and it is important you try to answer them yourself to understand how Python works. Exercises are shown in blue boxes followed by a yellow box that contains the answer of each exercise. We recommend you to try to answer each exercise yourself before looking at the solution.

Exercise

This is an exercise. You will need to click in the below box to see the answer.

This is the answer.

Last, we will highlight important points using green boxes like this one:

Key points

These are important concepts and technical notes.