December 2018
Beginner to intermediate
682 pages
18h 1m
English
As was stated earlier, it is possible to use one long boolean expression in place of several other shorter ones. To replicate the final_crit_a variable from step 1 with one long line of code, we can do the following:
>>> final_crit_a2 = (movie.imdb_score > 8) & \ (movie.content_rating == 'PG-13') & \ ((movie.title_year < 2000) | (movie.title_year > 2009))>>> final_crit_a2.equals(final_crit_a)True