How would I re-write this function using a list comprehension? The resulting function should only have 2 lines: the definition line and the return line containing a list comprehension expression.
def processList(listOfNumbers):
result = []
for i in listOfNumbers:
if i<0:
result.append(i*i)
else:
result.append((i*i)+1)
return result