Learn String Manipulation by Building a Cipher - Step 41

Tell us what’s happening:

I write the program correctly which runs fine in other programs but in your it keeps telling me below message

text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
encrypted_text = ‘’
for char in text.lower():
if char == " ":
print (char)

Error" You should print the result of comparing char with a space inside your for loop."

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)

Error" You should print the result of comparing `char` with a space inside your `for` loop."

# User Editable Region

Error" You should print the result of comparing `char` with a space inside your `for` loop."

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.4.1 Safari/605.1.15

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 41

print the result of comparing char with a space (' ').

You are comparing char to space here:

char == " "

Print that.

You are printing just char.

1 Like

Thanks … but the question is a bit confusing, if you wanted the T or F return the question should ask for that and not just say print the comparison as the printing the result of comparing char with a space also applies to you doing the comparison of char ==" " and if true your print the value in char