I am dealing with a function that looks like this:
def A(x):
A=range(n)
A[0]=(bx[0] if condition1 else cx[0])
for i in range(1,n):
A[i]=((dx[i] if condition2 else ex[i])
return map(lambda x: x+3, A)
where A is a list and b,c,d,e are operations that take x as variable. Basically, I need to make an if statement for the first value in the A-list, and a different if statement for any other value apart from the first one. Is there a way to make this more efficient?
thank you