Tell us what’s happening:
My code is working but can’t pass the task I don’t understand the problem I switched the last print code with the ‘char:’, char, ‘new_char:’ , new_char but it won’t work.
Your code so far
# User Editable Region
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for char in text.lower():
index = alphabet.find(char)
new_index = index + shift
new_char = alphabet[new_index]
print('char:', char , 'new_char:' , new_char)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 35