Python range function?

I made a range function for a Python problem, but for some reason it's always retuning as true for the numbers even when it is false. Where might the error in the code be? def range_test(num): if num > 1 and num < 555: num is True else: num is False return num num =... show more I made a range function for a Python problem, but for some reason it's always retuning as true for the numbers even when it is false. Where might the error in the code be?


def range_test(num):
if num > 1 and num < 555:
num is True
else:
num is False
return num

num = int(input("Enter a number: "))
if range_test(num):
print( "{:d} is in range.".format(num))
else:
print("The number you entered is outside the range!")
1 answer 1