List slicing


why this code does not results the right answer? (Oops, try again. Your message doesn't look quite right; instead of "I am the secret message", it should be "I am the secret message!")
why it excludes "!"?

garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI"
print message


if you do this, "!" won't stock in message , then your code print I am the secret message ( miss ! )


Yes. Can you clarify why it won't stock in message?


because in list slicing (example string ), str[start:end:stride] end is exclusive
you can comeback to List Slicing Syntax :