def sum_even_integers(sequence):
    """
    What comes in:
      -- A sequence
    What goes out:
      Returns the sum of the items in the sequence that:
        -- are integers AND
        -- are even.
    Side effects:   None.
    Examples:
      sum_even_integers([3, 10, 6, 5, 5, 10])
        returns 10 + 6 + 10, which is 26

      sum_even_integers([3, 9, 10, 99, 101, 5, 6, 5, 5, 10])
        still returns 10 + 6 + 10, which is 26

      sum_even_integers(['hello', 3, 10, 6, 'bye', 5, 7.33, 5, 10])
        still returns 10 + 6 + 10, which is 26

    Type hints:
      :type sequence: list or tuple
    """
    # ------------------------------------------------------------------
    # EXAMPLE 2.  Iterates through a sequence,
    #   identifying and summing the items that are EVEN INTEGERS.
    #
    #   Note how:
    #     -- The TYPE function returns the TYPE of its argument.
    #     -- An integer X is EVEN if the remainder is 0
    #          when you divide X by 2 and take the remainder.
    # ------------------------------------------------------------------
    total = 0
    for k in range(len(sequence)):
        item = sequence[k]
        if type(item) is int:
            if item % 2 == 0:
                total = total + item

    return total

    # Here is an alternative (there are other alternatives as well):
    total = 0
    for k in range(len(sequence)):
        if (type(sequence[k]) is int) and (sequence[k] % 2 == 0):
            total = total + sequence[k]

    return total