1. Rewrite each of the functions below more compactly
to use better style.

a.
def isAlmostEqual(a, b):
    if abs(a-b) < 0.001:
        return True
    else
        return False


b.
def isCapitalized(string):
    if string[0].isUpper() == True:
        return True
    else:
        return False

c.
def isNotCapitalized(string):
    return string[0].isUpper() == False


2.  The following functions attempt to check if the values in a list are all the same, but they don't work. State what the problem is.

a.
def allEqual(somelist):
    first = somelist[0]

    for val in somelist:
        if val != first:
            return False
        else:
            return True

b.
def allEqual(somelist):
    first = somelist[0]
    for val in somelist:
        if val != first:
            return False