programming-examples/python/Function/Python function to check whether a number is in a given range.py

6 lines
185 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def test_range(n):
if n in range(3,9):
print( " %s is in the range"%str(n))
else :
print("The number is outside the given range.")
test_range(5)