How would I get these lists to pass through my function (is that the correct terminiology)?
Lists:
temp_a = [1, 2, 3, 4, 5]
temp_b = [2, 2, 3, 4, 1]
temp_c = [1, 0, 2, 2, 1]
Function (I have just put in the * here, but I want to define the list in the function):
def temp_class(temperature):
temp_class = []
for i in *:
if i < 3:
temp_class.append(0)
else:
temp_class.append(1)
Example that doesn't work:
temp_value = [tempclass(t) for t in temp_a] #initial function is wrong
print(temp_value)
What is wrong here? I have tried to look on Stack Overflow and elsewhere, but can't find anything. Maybe I am using the wrong terminology.
What do I use instead of the *?