# User Editable Region
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
for char in text.lower():
index = alphabet.find(char)
new_index = index + shift
new_char = encrypted_text
print('char:', char 'encrypted_text:', encrypted_text)
# 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 34
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for char in text.lower():
index = alphabet.find(char)
print(char, index)
new_index = index + shift
Step 34
Now you need to create a new_char variable at the end of your loop body. Set its value to alphabet[new_index].
my step 34 is Now, replace new_char with encrypted_text . Also, modify the print() call to reflect this change.I have to use print() and i did not get the same original code as you