import random


def shuffle(liste):
    """
    brief: choose randomly in the given liste
    Args:
        tab :a list of values, raise Exception if not
    Returns:
        the value selected randomly
    Raises:
        ValueError if input tab is not a list
    """
    if not(isinstance(liste, list)):
        raise ValueError('Expected a list as input')
    if not liste:
        raise ValueError('Expected a non empty list')
    index=random.randint(0,len(liste)-1)
    return liste[index]