def random_string(length):
    'Returns a random string of length :length: consisting of lowercase characters and digits\n\n    :param length:\n    :return:\n    '
    assert (length > 0)
    characters = (string.ascii_lowercase + ''.join([str(i) for i in range(10)]))
    return ''.join([random.choice(characters) for _ in range(length)])
Returns a random string of length :length: consisting of lowercase characters and digits

:param length:
:return:
def random_string(length):
    'Returns a random string of length :length: consisting of lowercase characters and digits\n\n    :param length:\n    :return:\n    '
    assert (length > 0)
    characters = (string.ascii_lowercase + .join([str(i) for i in range(10)]))
    return .join([random.choice(characters) for _ in range(length)])