Mercurial > hg > problem6
diff optim.py @ 9:69e65d1d94af draft
maint: keep line lengths to 80 chars
author | Jordi GutiƩrrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 11 Mar 2015 11:26:03 -0400 (2015-03-11) |
parents | b5cbd6bdb611 |
children | 9f485ecdc2a9 |
line wrap: on
line diff
--- a/optim.py +++ b/optim.py @@ -61,8 +61,9 @@ # We first sell the old machine, if any if slot: if machine.day == slot.day: - raise InvalidPlan("Cannot buy two machines on the same day: %d" - % (machine.day)) + raise InvalidPlan( + "Cannot buy two machines on the same day: %d" + % (machine.day)) # Subtract 1, because the machine in the slot cannot # be used the day it's sold. @@ -96,7 +97,8 @@ # Just count in binary to enumerate all plans N = len(machines) if N > 0: - plans = [[y == "1" for y in format(x, "0%db" % N)] for x in range(0, 2**N)] + plans = [[y == "1" for y in format(x, "0%db" % N)] + for x in range(0, 2**N)] else: plans = []