September 2026
1051 pages
35h 4m
English
Although we’ll often draw on the interactive mode, our goal is to write real Python programs as quickly as possible. It’s a special feature of the interactive mode that the value of an entered expression is automatically output. In a normal program, on the other hand, screen outputs must be generated by the programmer explicitly. To output the value of a variable, Python uses the print function:
>>> print(1.2)1.2
Note that while print outputs values, the automatic output of the interactive mode outputs representations, i.e. predominantly literals. For example, automatic output writes the value of a string in quotation marks while print doesn’t:
>>> "Hello World"'Hello World'>>> print("Hello World")Hello World
Here too, ...
Read now
Unlock full access