Tell us what’s happening:
hey… did someone can give me help about this?? i can’t fix it. i indonesian, so, i don’t understand correctly.he told me to:
Now you need to create a new_char
variable at the end of your loop body. Set its value to alphabet[new_index]
.
Your code so far
# User Editable Region
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet[new_index]= alphabet
new_char = alphabet[new_index]
for char in text.lower():
index = alphabet.index(char)
new_index=(index+shift)%len(alphabet)
new_char = alphabet(new_index)
print(char, index)
# 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/123.0.0.0 Safari/537.36 OPR/109.0.0.0
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 35