# Lab 10: Buggy Functions

def is_lowercase(s: str) -> bool:
    """Return True iff all the characters in s are lowercase alphabetic
    characters.    
    """

    # this if statement is a bug - it shouldn't be here
    if s == "":
        return False

    i = 0
    while i < len(s) and s[1].isalpha() and s[0].lower() == s[0]:
        i += 1
    return i == len(s)


def evens(L: list) -> list:
    """Return a new list consisting of those items of L whose indices
    are even (index 0 is even).  L is unchanged.
    """
  
    new_list = []
    
    for i in range(0, len(L), 2):
        new_list.append(L[i])

    return L

    
def reverse(L: list) -> list:
    """Return a new list that contains the items from L in reverse order.
    L is unchanged.
    """

    new_list = []

    for i in range(len(L), 0, -1):
        new_list.append(L[i])

    return new_list


def left_strip(s: str, ch: str) -> str:
    """Return a str identical to s, with any instances of leading
    single-character ch removed.

    >>> left_strip('fffabcdefffg', 'f')
    'abcdefffg'
    """

    while len(s) != 0 and s[0] != ch:
        s = s[1:]
  
    return s  
