def all_unique(s):
    """
    Returns a boolean which is True if each element in
    iterable was used only once.

    >>> all_unique('abcd')
    True
    >>> all_unique('ab')
    False
    """
    seen_it = {}
    for c in s:
        if c in seen_it:
            return False
        else:
            seen_it[c] = True
    return True