(email, last_chore)
Randomly selects a chore that isn't the 'last_chore the person had.
Randomly selects a chore that isn't the 'last_chore the person had.
Randomly selects a chore that isn t the last_chore the person had .
def get_chore(email, last_chore):
    """Randomly selects a chore that isn't the 'last_chore the person had."""
    chore_list = chores[:]
    try:
        chore_list.remove(last_chore)
    except ValueError:
        pass
    if chore_list:
        new_chore = random.choice(chore_list)
        chore_assignments[email] = new_chore
        chores.remove(new_chore)
    else:
        print('Reshuffling as a chore would have to have been repeated.')
def get_chore ( email , last_chore ) : chore_list = chores [ : ] try : chore_list . remove ( last_chore ) except ValueError : pass if chore_list : new_chore = random . choice ( chore_list ) chore_assignments [ email ] = new_chore chores . remove ( new_chore ) else : print ( 'Reshuffling as a chore would have to have been repeated.' )