def validate(contacts, number):
    """
    The validate() function accepts the contacts array and number as arguments and checks to see if the number inputted is in the range of the contacts array. It returns a number inputted by the user within that range.
    """
    while number<1 or number>len(contacts):
        print()
        print("Please enter a number from 1 to ", len(contacts))
        number = int(input("Number: "))
    return number