June 2025
Beginner to intermediate
473 pages
13h 30m
English
Unlike most other programming languages, you can try out Python without writing code to a file. Simply open a terminal window and run the python or python3 command in it. This will start an interactive Python environment. In it, the three >>> characters (the “Python prompt”) indicate the place where you can perform input yourself. (Enter) terminates the input, and Python then displays the result:
$ python>>> 1+2 3
When trying out Python interactively, you can mostly do without print, because results are displayed automatically anyway:
>>> x=5>>> print(x + 7) 12>>> x + 7 12
You can even enter multiline statements, such as for loops. There are two things to keep in mind: On the one hand, the ...
Read now
Unlock full access