Learn String Manipulation by Building a Cipher - Step 38

Tell us what’s happening:

Well the requirement is You should assign encrypted_text + alphabet[new_index] to your encrypted_text variable. But i can not find what i am doing wrong

Your code so far


# 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)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 38

Welcome to the forum @BlagaYanis

You appear to have modified the print call.
It it missing commas.

Please reset the step to restore the original code and try again.

Happy coding

1 Like