4 ms·
A generator expression would also avoid looping twice - this is valid python: total = sum(f(record) for record in housing_records)
by Izkata 2y ago
A generator expression would also avoid looping twice - this is valid python:
total = sum(f(record) for record in housing_records)