def replace_and_switch(name):
    """
    Replaces any vowels in the name to x
    and switches the first char and last char
    """
    output = list(name)

    for i, letter in enumerate(name):
        if letter.lower() in ["a", "e", "i", "o", "u"]:
            output[i] = "x"
        else:
            output[i] = letter

    last = output[-1]
    first = output[0]
    output[0] = last
    output[-1] = first

    return "".join(output)