def ones_comp(bin_str):
    """ Return the ones complement of a string of 0s and 1s """
    output = ""
    for i in bin_str:
        if i == '0':
            output += '1'
        if i == '1':
            output += '0'
    return output