import random


def genPwd(alpha, length):
    """
        Generate a random string (a password).

        ``alpha'' The characters that may be present in the password. Each character in alpha will be equally likely in the generated password.
        ``length'' The length of the password string.
    """
    # be sure that each character is exactly once present
    alpha = list(set(alpha))
    # return the created password
    return "".join([random.choice(alpha) for _ in range(length)])