Write a Python function to check whether a number is in a given range

 def check_range(n):

    if n in range (1,10):

        print("{} is in the range".format(n))

        return n

    else:

        print("{} is not in the range".format(n))

    return n   

n = int(input("Enter a Number : "))

print (check_range(n))



#OUTPUT

'''Enter a Number : 5

5 is in the range

5'''

Comments