Complete the method which accepts an array of integers, and returns one of the following:
* `"yes, ascending"` - if the numbers in the array are sorted in an ascending order
* `"yes, descending"` - if the numbers in the array are sorted in a descending order
* `"no"` - otherwise
You can assume the array will always be valid, and there will always be one correct answer.
def is_sorted_and_how(arr):
    arr_up = arr[0]
    arr_down = arr[0]
    check = 1
    for x in range(len(arr)):
        if arr[x] > arr_up:
            arr_up = arr[x]
            check += 1
    if check == len(arr):
        return 'yes, ascending'
    check = 1
    for x in range(len(arr)):
        if arr[x] < arr_down:
            arr_down = arr[x]
            check += 1
    if check == len(arr):
        return 'yes, descending'
    else:
        return 'no'
        
        


def is_sorted_and_how(arr):
    arr_up = arr[0]
    arr_down = arr[0]
    check = 1
    for x in range(len(arr)):
        if arr[x] > arr_up:
            arr_up = arr[x]
            check += 1
    if check == len(arr):
        return 'yes, ascending'
    check = 1
    for x in range(len(arr)):
        if arr[x] < arr_down:
            arr_down = arr[x]
            check += 1
    if check == len(arr):
        return 'yes, descending'
    else:
        return 'no'
        
        

