November 2017
Beginner to intermediate
204 pages
5h 23m
English
I've been taking it for granted so far that the Python shell automatically prints the result of any statement that is entered. However, if you want to see the result of a particular operation inside a Python program, you will need to explicitly print it using the print() function. To use the print() function, you can type print() with the value that you would like to print inside parentheses.
Here are some examples using the print() function:
or example:>> print(0)>> print(1+1)>> print('abc')>> print("abc" == "cba")
The syntax used with the print function may seem a bit strange right now, but it will become more clear when I introduce functions later in the chapter.
There are two areas that the print() function comes in ...
Read now
Unlock full access