[Solved] SyntaxError: invalid syntax Python issue


I do not fully understand what you wanted to achieve but i think is one of the following 2:

1.return a continuous range of value between minimum and maximum. In this case you can use range and do not pass Y as input param.

def Z(minimum,maximum):
    Y = range(minimum, maximum)
    return Y

print Z(2,4)

2.you want to slice Y between value at index minimum and maximum. the use the following:

def Z(Y,minimum,maximum):
    Y = Y[minimum:maximum]
    return Y

Y = [1,2,3,4,5,6,7,8,9]    
print Z(Y,2,4)

from your comment i think you want to use the version 2.
so you have simply forgot to put Y before [minimum:maximum]. you have to put Y to say that this is the variable to be sliced. have a nice explanation on how slice works here

1

solved SyntaxError: invalid syntax Python issue