List slicing


#1



What is wrong with my code. Output is correct yet interface is sending error message. Please help.


garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"
garbled = garbled[::-1]
end=len(garbled)
message = garbled[:end:2]
print message


#2

here:

garbled = garbled[::-1]

you can't store the reversed string in garbled, the exercise will get problems with the validation.

store it in a new variable or just in message


#3

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