Step 29
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().
text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
for char in text.lower():
index = alphabet.lower(char)
print(char, index)
the site keeps saying this is incorrect. i have looked overo other forms. and this is the answer.
Your code so far
# User Editable Region
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for char in text.lower():
index = alphabet.lower(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/121.0.0.0 Safari/537.36 OPR/107.0.0.0 (Edition std-1)
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 29
the tests do not check if you have find or not in that line. but python is really strict with the number of parameters and arguments, lower() expects 0 arguments, if you give it a different number of arguments you get an error that stop the execution of the code