May-03-2023, 02:35 PM
(May-03-2023, 06:25 AM)jasonkeller1970 Wrote: Is it possible?Yes it is. Try something like this
import itertools as itt def multirange(*args): return itt.product(*(range(*v) for v in args)) expr = input('Insert the binomial: ').strip() expr_func = eval(f'lambda a, b, c, d, e: {expr}') for a, b, c, d, e in multirange((1, 4), (1, 6), (5, 8), (1, 5), (5, 8)): x = expr_func(a, b, c, d, e) print(a, b, c, d, e, x)