When I create a new list in my function at the end I want to return that new list to replace the values that were initially called however when the return statement runs nothing actually happens.
def fixNumbers(list):
newList = []
for i in list:
if i > 255:
newList.append(225)
elif i < 0:
newList.append(0)
else:
newList.append(i)
return newList
values1 = [-10, 100, 300]
fixNumbers(values1)
print(values1)
values2 = [127, 216, 280, 250, 50, 0, -3, 20]
fixNumbers(values2)
print(values2)