import random


def construct_drink(_preference, _ingredients):
    """This function creates and returns drink based on a pirate's drink preferences"""
    drink = []
    for key, value in _preference.items():
        if value is True:
            drink.append(random.choice(_ingredients[key]))

    return drink