📌  相关文章
📜  在数组中查找一个数字 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:20.385000             🧑  作者: Mango

代码示例2
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])