import random
import string


def rand_string(L):
    """
    :param L: Integer, length of the string to randomly generate
    :return: String (of the given length L) of random characters
    """
    return ''.join(random.choices(string.ascii_lowercase + string.digits, k=L))