List Slicing print issue


#1

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"

message = garbled[::-1]
print message[::2]

Error: Oops, try again. Your message doesn't look quite right; instead of "IX XaXmX XtXhXeX XsXeXcXrXeXtX XmXeXsXsXaXgXeX!", it should be "I am the secret message!"

" I am the secret message!" is printed yet the error. I don't understand


#2

your message variable should contain the correct translation. it doesn't:

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"

message = garbled[::-1]
print message[::2]
print message # this should output correctly

#4

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