Learn String Manipulation by Building a Cipher - Step 43

Tell us what’s happening:

Describe your issue in detail i am stuck at this level, i am following the instructions and improving my code many times but still its not working. Exactly where i have to put that addition .

Your code so far

# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
for char in text.lower():
if char == ' ':
index = alphabet.find(char)
new_index = index + shift
    print('char:', char, 'encrypted text:', encrypted_text)

# 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/ Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 43

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!

1 Like

Hello @simonrilley067,
Welcome to FCC Forum,

You dont need any print becouse!It says instead of printing 'space!'.
Also at the space of print add encrypted_text. and use the additon assignment +=. and put char on it!
Happy coding :grinning:


Welcome to the forum @simonrilley067

Here is a comparison between the original code and your new code.

The code in red is your new code.
The code in blue is the original code.
Code in magenta is the overlap.

You appear to have changed the indentation of the code.

Please reset the step to restore the original code.

Now, instead of printing 'space!' , use the addition assignment operator to add the space (currently stored in char ) to the current value of encrypted_text .

So this is the code you need to replace.

    if char == ' ':

Happy coding


I love the way you solved the question!

1 Like

But, How did you create code above!

html: textarea elements
css: position set to absolute, and transparent background.

where can i get that please

thanks brother, i messed up a bit but your answer helped me

1 Like