Mercurial > hg > problem6
changeset 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 |
parents | b5cbd6bdb611 |
children | 88d646d80c31 |
files | optim.py |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
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 = []