A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-123.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6x:=100
7{
8x:=200
9fmt.Println(x)
10}
11fmt.Println(x)
12}
Iteration
Answer & explanation
Console output
200
100
Why
A standalone { } block creates a nested scope, and x := 200 inside it declares a new variable that shadows the outer x for the block only. The inner print sees 200; after the block the outer x (still 100) is printed. Shadowing never alters the outer variable.