Bug Found: Lambda Expressions


#1





Hello everyone, just thought I'd report a small bug in this exercise.
I received the error "It looks like your message is "I am the secret message!" instead of "I am another secret message!"
Problem being, as can be seen in the screenshot below, my message DID read "I am another secret message!"

See the screenshot: http://www.screencast.com/t/hWpbquCx9

I am certain my actual error was in not assigning the lambda expression to its own variable.
After I did so and printed the variable, I passed the exercise.


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


#2

Yes, that was your actual error.

Codecademy examined the variable, message, to verify that it existed, and if it did, it went on to eventually determine whether what message referred to was equivalent to the result of applying the correct filter to garbled. Since your code for this exercise did not assign anything to message, Codecademy discovered that message still referred to this ...

I am the secret message!

... from the previous exercise, due to the manner in which Codecademy manages memory.

If, while working on a Codecademy exercise, you suspect that you are getting results that are affected by objects that remain in memory from previous exercises or previous versions of your code from the current exercise, you can clean up by refreshing the page. Some users have had to perform a refresh after they assigned a value to the name of a built in function, such as abs or len, thereby losing the use of that function.


#3