import random


def choose(items):
    """
    Given a 2D list of options and respective probabilities, in form [option, prob]
    this will return a random option based on the given probabilities.
    """
    sum=0
    for i in items:
        sum += i[1]
    rnd = random.random() * sum
    for i, w in items:
        rnd -= w
        if rnd < 0:
            return i