When I run this code; even when the list contains only numbers, it still returns as an error when it should return [1, 2, 3]
. How can I fix this issue?
def check_integer(a, b, c):
if type([a, b, c]) != int:
raise TypeError("Must be numbers.")
else:
return [a, b, c]
print (check_integer(1, 2, 3))