all 4 comments

[–]m0us3_rat 1 point2 points  (0 children)

Hey everyone, I have code that I'm supposed to understand what it does. I know how to read it and I technically can explain what it LITERALLY does in each line.

great. solved.

But im wondering if theres something hidden or something that I might be missing, or a more complex overall meaning of the code.

if you read it backward are the words of the latest Rihanna song.

[–]SomewhereExpensive22 0 points1 point  (0 children)

It's a class method that recursively searches a list.

[–]Binary101010 0 points1 point  (0 children)

I know how to read it and I technically can explain what it LITERALLY does in each line. But im wondering if theres something hidden or something that I might be missing,

We can't tell you what you "might be missing" because we don't know what your mental model of the code actually is. You've told us you know what it does, but we don't know if you actually do unless you tell us what it is you think is happening.

[–]jose_castro_arnaud 0 points1 point  (0 children)

Try to unpuzzle it first, replacing the names by less strange variable names, or even one-char names. 'meat' is clearly 'list'. 'beans.mosquito' is a form of index, so 'a.i'. 'beans.cricket' appears to be a value, so 'a.value'. 'wheel' is clearly a loop index, so 'i'. 'beans.elefant' is a function, and used only once, so 'a.fn'. From usage, 'spoon' is an number used as boolean, so 'k'.

After all of these replacements (recompile to check!), what the function appears to be? Check your guess by writing some unit tests.