24 game/Solve: Difference between revisions

Content added Content deleted
(→‎{{header|Python}}: Now works with both Python 2.6. and 3.X (tested))
Line 37: Line 37:
input = raw_input
input = raw_input
from itertools import izip_longest as zip_longest
from itertools import izip_longest as zip_longest
else:
from itertools import zip_longest


def choose4():
def choose4():
Line 90: Line 92:
for d in digiperm:
for d in digiperm:
for ops in opcomb:
for ops in opcomb:
ex = list(chain(*zip_longest(d, ops, fillvalue='')))
ex = list(chain.from_iterable(zip_longest(d, ops, fillvalue='')))
for b in brackets:
for b in brackets:
exp = ex[::]
exp = ex[::]