My task was it to include upper case letters into the function which I thought I had completed as the code preview shows the letters being assigned correctly.
I wonder where I went wrong and appreciate any help you might provide.
Jonas ![]()
task:
find is again returning -1 for uppercase letters, and for the space character, too. You are going to take care of the space later on.
For now, instead of iterating over text, change the for loop to iterate over text.lower().
my code:
text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
for char in text:
index = alphabet.find(char.lower())
print(char, index)