Here is my MWE (which looks stupid):
def somefunc(a0,a1,b1,a2,b2):
first = 'a0'
rest = ['+a{}+b{}'.format(i,i) for i in range(1, int((len(locals())-1) / 2)
for element in rest:
first+=element
return exec(first)
Basically I want to create an expression without having to type it in. So I use list comprehension with strings and then I execute.
However if I try
somefunct(1,1,1,1,1)
I get absolutely nothing..