Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

However, the loop treats the iteration variable $value as local. So when it exits the list, $value regains the value it had before the loop. Because it was uninitialized before the loop, it remains undefined afterwards, and the final print statement prints {{ is even}}:

Code Block
 is even.

Compliant Solution (Expanded Loop)

...

 

 

...

Image Modified Image Modified Image Modified