This tutorial covers these topics:
Note: This tutorial is performed in Sublime Text 3 in laptop with Windows 7, 32 bit OS, Python 3.6.4.
Anyone without previous programming knowledge or novices can catch up with this tutorial.
In this series of tutorials, we learn the Python programming language from scratch and we will advance to an advanced level. This will be the first part of the tutorial that will cover the topic of programming fundamentals.
What is programming?
Programming is simply giving instructions to the computer to perform a specific task.
The instructions (commands) have a different appearance in each programming language, but there are some basic functions that are presented in almost all languages:
Input: receives data from the keyboard, or from a file or other device.
Output: shows data on the monitors or sends data to a file or other device.
Mathematics: performs basic mathematical operations such as addition, subtraction, multiplication and division.
Conditional operation: confirm the veracity of any condition and execute a sequence of appropriate instructions.
Repeat: perform some action repeatedly, usually with some variation.
What is debugging?
When programming, mistakes are made and the process of searching for them and correcting them is called debugging.
There are three types of errors that can occur in a program, syntax, runtime, and semantics.
What is Python?
Python is a programming language created by Guido van Rossum at the beginning of the 90s, it is a powerful scripting language, with dynamic typing, easy to learn, multiplatform and object oriented.
Download Python
The official Python page is https://www.python.org/
The latest version of Python currently available (March 2018) is Python 3.6.4.
Links: Python 3.6.4 download page, Python 3.6.4 installers for 64-bit Windows (30.2 MB) and 32-bit Windows (29.2 MB).
Install Python
Once the installer is downloaded, we double click on it to start the installation.
Download Sublime Text
The official page of Sublime Text is https://www.sublimetext.com/
The latest version of Sublime Text currently available (March 2018) is Sublime Text 3.
Links: page of download of Sublime Text 3 , installers of Sublime Text 3 for Windows 64-bit (8.5 MB) and Windows 32 bit (7.8 MB).
Install Sublime Text
Once the installer is downloaded, we double-click on it to begin the installation.
All our IDE is already installed!
Operate in the interactive development environment
IDLE (Integrated Development Environment for Python) is the development environment that allows you to edit and execute programs. We can also create and execute programs in Python without using IDLE.
Open IDLE Home> Python 3.6> IDLE (Python 3.6)
The prompt is the character string >>> that appears on the last line. The prompt indicates that the Python interpreter expects us to enter an order using the keyboard
Our first program
print("Hello World")
This is an example of the instruction * print *, it is responsible to print a value on the screen. In this case the result is the words * Hello world *.
The quotes mark the beginning and end of the value, they do not appear in the result.
print('Hello World')
print()