why is my coding wrong?
alphabet='abcdefghijklmnopqrstuvwxyz'
word_test='the cat sat on the map'
def encrypt(text,num):
output= ' '
for char in word_test:
alpha_index = alphabet.find(char)
def shift_amount(i):
for i in alpha_index:
shift_amnount= (alpha_index+num)%26
output= output + alphabet(alpha_index+shift_amount)
return output
2 answers ( 0 marked as helpful)
shift_amnount= (alpha_index+num)%26 1
output= output + alphabet(alpha_index+shift_amount) 2
I think you use wrong variable (1) shift_amnount and (2) shift_amount
thank you so much.