FREE ONLINE INTERACTIVE COURSE

Python 3

FOR BEGINNERS

LESSON 1
PAGE 1 / 3
First steps in Python 3
Home >>> Free online lessons

First instructions

The Python language is interpreted, i.e. the code is executed line by line, unlike Pascal or C/C++, where a compiler is needed to generate an executable file. The console gives us the ability to execute a Python command and get the effect immediately. The current position is indicated by the three characters ">>>" and the cursor ("|").

The simplest commands display text or the result of arithmetic operations:

EXERCISE 1

Enter the instruction print ("Hello, Python!") and then press the Enter key. Watch out for those quotes!
EXERCISE 2

Arithmetic calculations? Nothing simpler, we can write them directly in the Python console! Enter the command 2+3*5-1 and then press the Enter key.

Is the console enough?

The way of working directly in the console (called "Python Interactive Console") is interesting, different from the one known maybe until now, but we still need programs that contain several lines of code, written and executed together, to get good results, following elaborate calculations or algorithms. The console is useful when we need quick access to Python or test certain commands.

On the next page we will write your first programs!

Solve the two exercises before continuing. Each contains important feedback!
 home   list  LESSONS   arrow_upward