I'm in a big dilemma, take the following code written in ML:

```
val x = 1
fun f(y) = x + y
val x = 2
val y = 3
val z = f (x + y)

```

The value of z is 6. Now if I write the same code in python the value of z would be 7. And both languages claim(actual the teachers that teach these languages claim this) to have Lexical / Static scope. But it looks like only ML has it by using the environment that was creating when the f function was defined whenever f is called

Any pointers would be greatly appreciated!

Thanks!