import random


def randint(low, height=None): 
    """
       if height is none, then range is [0, low) 
       else range is [low, height)
       usage:
        >>> n = randint(0, 10)
        >>> print 0 <= n < 10 
        True
        >>> n = randint(3)
        >>> print 0 <= n < 3
        True
    """
    if height:
        return random.randint(low, height - 1)
    else:
        return random.randint(0, low - 1)