18 Lambda Expressions



I receive the following error:

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

I don't understand why my code is returning 'the' instead of 'another'


message == filter(lambda x: x == 'X', garbled)

print message


HI this line

message == filter(lambda x: x == 'X', garbled)

first after message you should = instead of == because you want to save the filter() inside message and not compare it..
then this part

x == 'X'

in this case it will print all the X instaed of the others letter


Thank you so much, :slight_smile: that worked perfectly


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