Learn String Manipulation by Building a Cipher - Step 26

Tell us what’s happening:

I can’t seem to get my code to succesfully run my code that ive attempted is as follows - STEP 26 (scientific computing with python)(manipulation by building a cipher) :

for char in text.lower():
index = alphabet.find(char)
print(char, index)
new_index = index + shift

Your code so far

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'

# User Editable Region

for char in text.lower():
    index = alphabet.find(char)
    print(char, index)
    new_index = index + 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/124.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 26

declare a variable called index and assign the value returned by alphabet.find(char) to this variable.

index = alphabet.find(char) 

This is good :+1:

print(char, index)
new_index = index + shift

What’s this? Looks like code from a step later on…
Why did you modify the print statement?

Just do what the instructions ask and nothing more