Why is my code not working?


#1



Advanced Topics 18. Lambda Expressions


This is the error message I got.

"Oops, try again. It looks like your message is "I am the secret message!" instead of "I am another secret message!""


The output of my code is this.

I am another secret message!
None

This is my code.

garbled = "IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX"
print filter(lambda x: x != 'X', garbled)

Why is this not working?


#2

you tried to shortcut, you should store the result of the filter action in a variable which should be named message. then on the next line, print message.

Sometimes trying a shortcut/shorthand will create problems in the lesson


#3

Thank you! The error message was a bit confusing though but I went back and it was fixed. I'll try and read the lesson instructions better from now on.


#4