Develop an algorithm in Python that takes an array of integers and returns the maximum of the numbers.
[7, 9, 5, 10, 2]
def get_max(arr):
    max_num = None

    for num in arr:
        if max_num == None or num > max_num:
            max_num = num 

    return max_num

result = get_max([7, 9, 5, 10, 2])
print(result)