def gen_random_string ( str_len ) : return '' . join ( random . choice ( string . ascii_letters + string . digits ) for _ in range ( str_len ) )
random string of 5 characters inn python
generate random string with specified length
def gen_random_string(str_len):
    """ generate random string with specified length
    """
    return ''.join(
        random.choice(string.ascii_letters + string.digits) for _ in range(str_len))