Develop an algorithm in Python to check if an array contains a given number.
array = [2, 4, 6, 8], number = 8
def checkNumber(array, number):
    for i in array:
        if i == number:
            return True
    return False

checkNumber([2, 4, 6, 8], 8)