Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

I keep receiving this error " You should declare a variable called shifted " on Step 16

Your code so far

text = ‘Hello World’

shift = 3

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

index = alphabet.find(text[0].lower())

print(index)

shifted = ‘h’ + shift


/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0].lower())
print(index)

shifted = 'h' + shift


/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

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.

Welcome to the forum @chancepc69

You have declared an argument (h) for shifted, not a parameter.

Also, how is it accessing the alphabet string.

Carefully reread the instructions

Happy coding

let us look at your code above and folow it to solve your challenge.
text[0]: extract the first letter in your variable ( “text” ) or letter at the 0 index.
do the same with “alphabet” in place of 0, put “index + shift” as value.

If you have any challenge after applying this please do let us know.

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