Apr-11-2019, 07:02 PM
def function_1(x): if x < 0: return -1000000000 else: return (x ** (1-2)-1)/(1-2) list = [1, 2, 3, 4,] [function_1(i) for i in list]so I have a function (with a condition as above) -- the intent is to apply that function to each number in a list (and get a new list with the result). Getting stuck here with error: "TypeError: '<' not supported between instances of 'list' and 'int'"
all help appreciated