#CB2240 week 7 homework
#Tse Tsz Wong
#57153200
alphabet_list = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
oringal_word = (input("Message? "))
oringal_word = oringal_word.upper()
shift_index = int(input("Shift? "))
encrypted_word=[]
i = 0
while i< len(oringal_word):
    a = alphabet_list.index(oringal_word[i])
    encrypted_word.append(alphabet_list[(a - shift_index)%26])
    i += 1

print("Encrypted Message:", ''.join(encrypted_word) , "\n\nPress Enter to exit.")
