Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

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

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Hello Akhilakki,

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.

Please let me know if you’re still stuck.

3 Likes

thank you very much i just found that reading your message really helped out i got the answer… :smile:

4 Likes

thank you for the help and time , your response it means a lot

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.