Q:

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

0

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

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used python 3.7 compiler for debugging purpose.

def test_range(n):
    if n in range(10,20):
        print( "Number %s is in the range"%str(n))
    else :
        print("The number is outside the given range.")
test_range(15)

Result:

Number 15 is in the range

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a Python function that accepts a string and ... >>
<< Write a Python function to calculate the factorial...