← Back to archive

Stdle #28 · iteration · 2026-07-04

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
func main() {
grade := 'B'
switch grade {
case 'A':
fmt.Println(4)
case 'B':
fmt.Println(3)
case 'C':
fmt.Println(2)
}
}
Iteration
4 attempts left

Answer & explanation