def generate_temp_password(length):
    if not isinstance(length, int) or length < 8:
        raise ValueError('temp password must have positive length')
chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789'
Generate password in python