# Learn String Manipulation by Building a Cipher - Step 38

### Tell us what’s happening:

Hello,

I’m working on a coding exercise and encountered an issue. The prompt asks me to print ‘space!’ in my if statement when a space is encountered, but it’s not accepting my solution.

Also, the `encrypted_text` in the if statement on line 8 is marked as incorrect, regardless of whether it contains a space. That why I believe the wrong not in there.

Could anyone provide some guidance? Thank you!

``````
/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''

for char in text.lower():
if char ==' ':
encrypted_text += ' '
print('space!')
else:
index = alphabet.find(char)
new_index = index + shift
encrypted_text += alphabet[new_index]
print('char:', char , 'encrypted text:', encrypted_text)

/* User Editable Region */

``````

### Challenge Information:

Learn String Manipulation by Building a Cipher - Step 38

Hello Pkj,

It seems like you are too fast for the excercise haha. You don’t have to add the space char to the encrypted text yet. You just have to print space.

thx a lot but it still not wrok

I had try to delete the code which is

``````text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''

for char in text.lower():
if char ==' ':
encrypted_text += ' '
print('space!')

index = alphabet.find(char)
new_index = index + shift
encrypted_text += alphabet[new_index]
print('char:', char, 'encrypted text:', encrypted_text)
``````
``````text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''

for char in text.lower():
if char ==' ':
encrypted_text += ' '
print('space!')

index = alphabet.find(char)
new_index = index + shift
encrypted_text += alphabet[new_index]
print('char:', char, 'encrypted text:', encrypted_text)
``````

but it still not pass the step

You’re still adding a space caharacter to encrypted text after the if expression:
`encrypted_text += ' '`
The question mention you doing this yet. If you remove this you should be able to pass it.

I did it! I’ve been stuck on this question for a while. Your help was greatly appreciated!

1 Like

I think it might be punctuation and space error.

Just try initialise your encrypted_text = ’ ’ to have empty space meaning quotaion marks with a single space in-between them and run it. I think it may resolve the issue.