Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

I have every seemingly possible way to do this, and I’m sure its something simple I am missing

Your code so far

text = ‘Hello World’

shift = 3

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

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

print(index)

shifted = index + shift

print(shifted)


/* User Editable Region */

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

/* 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/120.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 16

Use this format

variable = string[num1 + num2]

You were correct up to here:

shifted =

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

1 Like

Thank you for the help it worked!