Answers for "Find a number in an array"

1

find number in array js

array.include(numberWhichYouWantToFInd);
// if present it will return true otherwise false
Posted by: Guest on February-04-2021
0

Find a number in an array

arr = [0,1,2,3,4,5,6,7,8,9]

# A dictionary to check true or false
check = {True: "YES", False: "NO"}

# Define the function 
def findNumber(arr, k):
    # print the dictionary with the built in method for searching array elements
        print(check[k in arr])
Posted by: Guest on August-16-2021

Code answers related to "Find a number in an array"

Python Answers by Framework

Browse Popular Code Answers by Language