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().
Your code so far
/* User Editable Region */
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for char in text:
index = alphabet.find(char)
print(char, index)
/* User Editable Region */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 25
In the code you’ve provided, The letter ‘H’ and ‘W’ are in Uppercase. So, it is returning the index as -1. To avoid this we are using the lower() function in the creation of the ‘for loop’.
If you are still stuck, here is a hint on how to add the lower() function: