Learn String Manipulation by Building a Cipher - Step 41

Tell us what’s happening:

I’ve ran into an issue with the (print) part of my if char == ’ ': part of my code, I keep getting the “You should print the string ‘space!’ inside your new if statement.” error code can I get some help please

Your code so far


# User Editable Region

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

for char in text.lower():
    if char == ' ':
    print(char == ' ':)
    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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 41

Let’s make sure you are ready to solve programming problems rather than me telling you the answer.

First step to solving any problem is to check the console for any error messages. Do you see an error message in the console? If so, what it does say?

Please fix identation in your code
To my understanding the task says:
If the char is empty space then print(space!) otherwise it should return false

You need to replace the print( char==‘ ‘) completely