I have written a for loop which gives me all the values of a specific letters place in the alphabet.
For example the word hello will give me the numbers 8, 5, 12, 12 and 14. Now I want to add them to another word which is the same length for e.g abcde, which would be 1, 2, 3, 4 and 5. Now I want to add the two numbers together but keeping the individual numbers for example 8+1, 5+2, 12+3, 12+4 and 14+5.
This is the code I have so far
for letter in message:
if letter.isalpha() == True:
x = alphabet.find(letter)
for letter in newkeyword:
if letter.isalpha() == True:
y = alphabet.find(letter)
When I try adding x
and y
, I get a single number. Can someone help?