def checkInput(var, arr):
    """
    check if input is a number and is in range of array's length
    """
    # check whether the input is a number
    while (not var.isnumeric()):
        var = input(f"Wrong input, choose a number 1-{len(arr)}: ")

    var = int(var)

    # check if the inpunt is correct
    while (var < 1 or var > len(arr)):
        var = int(input(f"Wrong input, number in range 1-{len(arr)}: "))

    return var