Table des matières
1.0 Welcome to Python Essentials 1................................................................................................1
1.0.1 Learn Python – the language of today and tomorrow........................................................1
1.0.2 About the course.....................................................................................................................1
1.0.3 Syllabus..............................................................................................................................2
1.0.4 Prepare for the PCEP-30-0x exam.....................................................................................2
Dive into programming, learn Python from scratch, and prepare for the PCEP – Certified
Entry-Level Python Programmer certification............................................................................2
1.1 Section 1 – Introduction to Programming..................................................................................3
1.1.1 How does a computer program work?...............................................................................3
1.1.2 Natural languages vs. programming languages.................................................................4
1.1.3 What makes a language?....................................................................................................4
Complete 1.1.4 Machine language vs. high-level language.......................................................5
1.0 Welcome to Python Essentials 1
1.0.1 Learn Python – the language of today and tomorrow
This course is the first in a two-course Python Essentials series. It covers everything you need to
know to start designing, writing, running, debugging, and improving Python programs at the
foundational level. It also fully prepares you for the PCEP – Certified Entry-Level Python
Programmer certification exam from the Python Institute.
1.0.2 About the course
Welcome to Python Essentials 1! This course has been designed and developed by the OpenEDG
Python Institute in partnership with the Cisco Networking Academy.
The course has been created for anyone and everyone who wants to learn Python and modern
programming techniques. It will particularly appeal to:
• aspiring programmers and learners interested in learning programming for fun and for job-
related tasks;
• learners looking to gain fundamental skills and knowledge for an entry-level job role as a
software developer, data analyst, or tester;
• industry professionals wishing to explore technologies that are connected with Python, or
that utilize it as a foundation;
• team leaders, product managers, and project managers who want to understand the
terminology and processes in the software development cycle to more effectively manage
and communicate with production and development teams.
During the course you will have access to hands-on practice materials, labs, quizzes,
assessments, and tests to learn how to utilize the skills and knowledge gained from studying the
resources and performing coding tasks, and interact with some real-life programming challenges
and situations.
1.0.3 Syllabus
In this course you will learn:
• the universal concepts of computer programming;
• the syntax and semantics of the Python language;
• practical skills in resolving typical implementation challenges;
• how to use the most important elements of the Python Standard Library;
• how to install your runtime environment;
• how to design, develop, test, and debug simple Python programs.
The course is divided into four modules:
1. Module 1
Introduction to Python and computer programming;
2. Module 2
Data types, variables, basic input-output operations, and basic operators;
3. Module 3
Boolean values, conditional execution, loops, lists and list processing, logical and bitwise
operations;
4. Module 4
Functions, tuples, dictionaries, exceptions, and data processing.
1.0.4 Prepare for the PCEP-30-0x exam
Dive into programming, learn Python from scratch, and prepare for the
PCEP – Certified Entry-Level Python Programmer certification
Python Essentials 1 is aligned with the PCEP – Certified Entry-Level Python Programmer
certification, a professional credential that demonstrates the holder’s understanding of the Python
language syntax and semantics, as well as their proficiency in using the most essential elements of
the language, tools, and resources to design, develop, and refactor simple Python programs.
The certification holder knows the syntax of the Python language to a degree that allows them to
work with variables, operators, control flow mechanisms, and functions, as well as understands the
fundamentals of the Python data type system, exception handling, troubleshooting, debugging, and
the runtime environment.
PCEP – Certified Entry-Level Python Programmer certification is an interim step to the PCAP –
Certified Associate in Python Programming certification, and the starting point to launch a career in
software development, Python programming, and related technologies.
Becoming PCEP certified will help you stand out from other candidates and get your foot in the
door.
For more information about the PCEP – Certified Entry-Level Python Programmer certification,
please visit www.pythoninstitute.org.
So, are you ready to begin your Python journey? Click Next to proceed to Section 1 and start
learning. See you there!
1.1 Section 1 – Introduction to Programming
Hello there, and welcome to section one! We will start off by learning about some of the universal
concepts of programming, such as instruction list, source file, language elements, compilation and
interpretation. Ready? Let's start!
1.1.1 How does a computer program work?
A program makes a computer usable. Without a program, a computer, even the most powerful one,
is nothing more than an object. Similarly, without a player, a piano is nothing more than a wooden
box.
Computers are able to perform very complex tasks, but this ability is not innate. A computer's nature
is quite different.
It can execute only extremely simple operations. For example, a computer cannot understand the
value of a complicated mathematical function by itself, although this isn't beyond the realms of
possibility in the near future.
Contemporary computers can only evaluate the results of very fundamental operations, like adding
or dividing, but they can do it very fast, and can repeat these actions virtually any number of times.
Imagine that you want to know the average speed you've reached during a long journey. You know
the distance, you know the time, you need the speed.
Naturally, the computer will be able to compute this, but the computer is not aware of such things as
distance, speed, or time. Therefore, it is necessary to instruct the computer to:
• accept a number representing the distance;
• accept a number representing the travel time;
• divide the former value by the latter and store the result in the memory;
• display the result (representing the average speed) in a readable format.
These four simple actions form a program. Of course, these examples are not formalized, and they
are very far from what the computer can understand, but they are good enough to be translated into
a language the computer can accept.
Language is the keyword.
1.1.2 Natural languages vs. programming languages
A language is a means (and a tool) for expressing and recording thoughts. There are many
languages all around us. Some of them require neither speaking nor writing, such as body language;
it's possible to express your deepest feelings very precisely without saying a word.
Another language you use each day is your mother tongue, which you use to manifest your will and
to ponder reality. Computers have their own language, too, called machine language, which is very
rudimentary.
A computer, even the most technically sophisticated, is devoid of even a trace of intelligence. You
could say that it is like a well-trained dog - it responds only to a predetermined set of known
commands.
The commands it recognizes are very simple. We can imagine that the computer responds to orders
like "take that number, divide by another and save the result".
A complete set of known commands is called an instruction list, sometimes abbreviated to IL.
Different types of computers may vary depending on the size of their ILs, and the instructions could
be completely different in different models.
Note: machine languages are developed by humans.
No computer is currently capable of creating a new language. However, that may change soon. Just
as people use a number of very different languages, machines have many different languages, too.
The difference, though, is that human languages developed naturally.
Moreover, they are still evolving, and new words are created every day as old words disappear.
These languages are called natural languages
1.1.3 What makes a language?
We can say that each language (machine or natural, it doesn't matter) consists of the following
elements:
a set of symbols used to build words of a certain language (e.g., the Latin alphabet for English, the
Cyrillic alphabet for Russian, Kanji for Japanese, and so on)
(aka a dictionary) a set of words the language offers its users (e.g., the word "computer" comes
from the English language dictionary, while "cmoptrue" doesn't; the word "chat" is present both in
English and French dictionaries, but their meanings are different)
a set of rules (formal or informal, written or felt intuitively) used to determine if a certain string of
words forms a valid sentence (e.g., "I am a python" is a syntactically correct phrase, while "I a
python am" isn't)
a set of rules determining if a certain phrase makes sense (e.g., "I ate a doughnut" makes sense, but
"A doughnut ate me" doesn't)
Complete 1.1.4 Machine language vs. high-level language
The IL is, in fact, the alphabet of a machine language. This is the simplest and most primary set
of symbols we can use to give commands to a computer. It's the computer's mother tongue.
Unfortunately, this mother tongue is a far cry from a human mother tongue. We both (computers
and humans) need something else, a common language for computers and humans, or a bridge
between the two different worlds.
We need a language in which humans can write their programs and a language that computers may
use to execute the programs, one that is far more complex than machine language and yet far
simpler than natural language.
Such languages are often called high-level programming languages. They are at least somewhat
similar to natural ones in that they use symbols, words and conventions readable to humans. These
languages enable humans to express commands to computers that are much more complex than
those offered by ILs.
A program written in a high-level programming language is called a source code (in contrast to the
machine code executed by computers). Similarly, the file containing the source code is called the
source file.
1.1.5 Compilation vs. Interpretation