List slicing - Unsure why incorrect?


I am the secret message!

But gives me a message "Oops, try again. Your message doesn't look quite right; instead of "I am the secret message!", it should be "!gse ecsetm ""

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"
garbled = garbled [::-2]

message = garbled
print message


You have to save it to message variable directly,as instruction says.

Instruction says..

Use list slicing to extract the message and save it to a variable called message

(I think it throws error beacuse youre not following exact instructions)


Boom worked:

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"
message = garbled[::-2]

Thanks for that, been staring at it for like 10 minutes trying to find my mistake


You can edit your final code here so no one copies your solution :wink:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.