September 2013
Intermediate to advanced
350 pages
9h 38m
English
In Writing and Running a Program, built-in function print was used to print values to the screen. We will use print to print messages to the users of our program. Those messages may include the values that expressions produce and the values that the variables refer to. Here are two examples of printing:
| | >>> print(1 + 1) |
| | 2 |
| | >>> print("The Latin 'Oryctolagus cuniculus' means 'domestic rabbit'.") |
| | The Latin 'Oryctolagus cuniculus' means 'domestic rabbit'. |
Function print doesn’t allow any styling of the output: no colors, no italics, no boldface. All output is plain text.
The first function call does what you would expect from the numeric examples we have seen previously, but the second does something ...
Read now
Unlock full access