# 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
encrypted_text += alphabet[new_index]
print('char:', char, 'encrypted text:', encrypted_text)
if char == " ":
print()
# User Editable Region
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 41
No, if the instructions don’t mention deleting anything, then you don’t need to.
“At the beginning of your loop body”
This means the next line after the for statement. for creates the for loop, and the next indented line is beginning of the loop body, the code block that will be executed in a loop:
for char in text.lower():
If you have any more questions please open a new topic, thanks!