Is there a way of using the list-comprehension "syntax" in functions, to reduce calculation/calls (a bit like try/catch) e.g a way of writing
customers=dict
for customer in customers:
if movie not in customers[customer]:
customers[customer].append(movie)
as
for customer in customers:
p.append(movie) if movie not in p=customers[customer]
if the call/operation p
was very heavy, thus it makes a big deal, if it is called once or twice