hii … i dont know how to do this exercise can any one help?
/* User Editable Region */
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[7].lower())
shifted=index+shift
print(shifted)
/* 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 Edg/120.0.0.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 16
So right now you declared a shifted variable and assigned it index + shift.
You found out last step that index prints 7. And we can see that shift is 3. So essentially you made shifted into 7 + 3 which is 10. You now see 10 in your preview on the right.
But the question is asking to find the letter at the value of index plus the value of shift . So what you are missing is getting the right character from your alphabet string at this location.
As a hint, in a previous step you found the location of the letter o in your text string by using text[7]. Now you gotta do something similar but with the alphabet string, and using index + shift.