October 2017
Intermediate to advanced
532 pages
16h 10m
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
Read now
Unlock full access