I used answers from here and here to make compose this. Here is one way you might do it, using the string class to get rid of punctuation and numbers.

import string

phrase = input("Please enter the phrase to be encrypted: ")  #prompt user for phrase
encryptionkey = input("Please enter the key: ")   #prompt user for encryption key


#replace - gets rid of spaces
#first translate - gets rid of punctuation
#second translate - gets rid of digits
#upper - capitalizes.

phrase = phrase.replace(" ", "")\
    .translate(str.maketrans('', '', string.punctuation))\
    .translate(str.maketrans('','',string.digits))\
    .upper()


times_to_repeat = len(phrase)//len(encryptionkey)
leftover_length = len(phrase)%len(encryptionkey)

#multiply string by how many times longer it is than the encryption, then add remaining length.

#in python you can do 'string'*2 to get 'stringstring'

final_phrase = encryptionkey*times_to_repeat+encryptionkey[:leftover_length]

print(final_phrase)

Output: enter image description here


# Only keep the alphabet characters
phrase = ''.join(c for c in phrase if c.isalpha())  
# Add the encryption key at least 1 more times than divisible (to count for remainder)
# and slice the output to the length needed
phrase = (encryptionkey * (1 + len(phrase) // len(encryptionkey)) [:len(phrase)]