def generate_random_alphanumeric(length):
 return ''.join((random.choice((string.ascii_uppercase + string.digits)) for _x in range(length)))

def generate_random_alphanumeric ( length ) : return '' . join ( ( random . choice ( ( string . ascii_uppercase + string . digits ) ) for _x in range ( length ) ) )
creates a random alphanumeric string of specified length .