Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

Describe your issue in detail here.
Hi guys :wave:Declare a variable named shifted and assign it the alphabet letter at index plus shift . How do I go about this please

Your code so far

/* User Editable Region */

text = 'Hello World'
shift = 3

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

shifted = 'h' + shift

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ 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.

Hey, here you should assign to shifted the value of alphabet at the index index + shift. You need to use the bracket notation on alphabet for that.

1 Like

Use the format

variable = string[var1 + var2]

You got the variable correct:

shifted =

The string is alphabet

If you’re still stuck check these solved topics: