all accepts an iterable and returns True if all of its elements are evaluated to True, False otherwise. The n % i == 0 for i in range(2, 21) part returns an iterable with 19 True or False values, depending if n is dividable by the corresponding i value.