There's more...

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset