November 2018
Beginner
304 pages
7h 35m
English
One of the most common control structures you'll use, and run into in other programs, is the if...else conditional block. Simply put, the program asks a yes or no question; depending on the answer, different things happen.
If you've programmed in other languages, the if...else statement works the same way. The key difference is that, in Python, the elseif statement is written as elif for checking multiple conditions, as shown in following screenshot:

In the preceding example, the preference() function is used to hold the main code logic; functions are explained in Chapter 4, Functions and Object ...
Read now
Unlock full access