Many Python statements we write are compound statements: there is one statement nested inside another. The outer statement is called the ‘if’ statement, and the inner statement is called the ‘then’ statement. The ‘if’ statement determines whether to execute the ‘then’ statement. Specifically, the ‘then’ statement is executed insofar as the ‘if’ statement evaluates to ‘True.’ Snippet 4.28 illustrates a control flow case, a simple rule-based product recommender that suggests products based on users’ purchasing patterns. If product x belongs to a user’s set of past purchases, then a certain item is recommended; otherwise, no recommendation is offered (see lines 7 and 8, containing the else statement).