Describe your issue in detail here.
##KingMrMonopoly: Hello I’m having a problem with this line of code anything that you suggest I do different?
Your code so far
/* User Editable Region */
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0].lower())
print(index)
shifted = alphabet.find(text[7].lower()) + shift
/* 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/104.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 16
Do you remember how to access a letter position of a string? text[0] accesses the letter at the first (0) position of text.
You want to access a letter in the string alphabet at the position index + shift
Try these steps:
declare a variable named shifted and assign it the string alphabet
modify the assignment into alphabet at position index using square brackets
modify the position in the square brackets to index + shift
You know if you want to access the h in alphabet would be alphabet[7] since you already found the position. Now you want to slide 3 (stored in the shift variable) letters down the alphabet from h and get that letter.