You can abstract it out to a function but I think its overkill, even if you generalize to something like print_area_filter(heights, widths, value, cmp) or whatever
If its not in a function, your example may (or may not depending on length if either a or b have a length of zero) create a floating variable called area out there.
If its not in a function, your example may (or may not depending on length if either a or b have a length of zero) create a floating variable called area out there.