Need help with this piece of code as the answer comes up to to 25

Need help with why is the answer 25 and not something else ??
Please help as others say this is incomplete code .

Hello and welcome.

First thing: please refrain from posting image files, unless there is no other way for you to illustrate your question.

That said: your ask for ‘help’, is a fair enough ask, but exactly is it that you’re asking?

Here’s a hint: Unless L is exactly [1, 3, 5, 7, 9] or a permutation thereof, the while loop will never terminate. Can you see why?

Given that constraint, what must val be?

3 Likes

Thank you so much :pray: