示例#1
0
def randint(*args, **kwargs):
    """
    Usage: $randint(start, end)
    Returns random integer in interval [start, end]

    """
    if len(args) != 2:
        raise TypeError("$randint needs two arguments - start and end.")
    start, end = int(args[0]), int(args[1])
    return base_randint(start, end)
示例#2
0
def randint(*args, **kwargs):
    """
    Usage: $randint(start, end)
    Returns random integer in interval [start, end]

    """
    if len(args) != 2:
        raise TypeError("$randint needs two arguments - start and end.")
    start, end = int(args[0]), int(args[1])
    return base_randint(start, end)
示例#3
0
def randint(maximum=100, minimum=0):
    """
    Generate a random integer between `minimum` and `maximum`.
    Args:
        - `maximum` - The maximum integer that can be generated (defaults to 100)
        - `minimum` - The minimum integer that can be generated (defaults to 0)
    Returns:
        A random integer
    Usage:
        ``random()``
        ``random(300)``
        ``random(10, 5)``
        ``random(minimim=20, maximum=40)``
    """
    return base_randint(minimum, maximum)