Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

The problem is stated:

As you can see from the output, "h" is at index 7 in the alphabet string. Now you need to find the letter at index 7 plus the value of shift. For that, you can use the addition operator, +, in the same way you would use it for a mathematical addition.

Declare a variable named shifted and assign it the alphabet letter at index plus shift.

And I type the code shown below. k is out. Shouldn’t it be the answer? Or what the question want is 10?

Your code so far

# User Editable Region

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

# 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/ Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 16

The problem is in your index.
Try: alphabet.index(text[0].lower())
text. lower()[0] this causes an error when you call the method on it.
Hope this helps.

Solved. No need b in the code but just put the index + shift in shifted