def alt_case(string, lower_first=True):
    """Returns the string with alternating upper and lowercase characters.

    lower_first: if True, first character is lowercase; if False, first character is uppercase"""
    string = string.lower()
    for i in range(len(string)):
        if bool(i % 2) == lower_first:
            string = string[: i] + string[i].upper() + string[i+1:]
    return string