Tech Study

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

Introduction

Write a Python function to check whether a number is in a given range. 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

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

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

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more