A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-18.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6varnums=[]interface{}{1,"two",3.0}
7for_,n:=rangenums{
8fmt.Printf("%T ",n)
9}
10fmt.Println()
11}
Interfaces
Answer & explanation
Console output
int string float64
Why
An []interface{} (now []any) can hold values of any concrete type, and %T reports each element's dynamic type. The literals 1, "two", and 3.0 are int, string, and float64 respectively. Each %T is followed by a space, producing "int string float64 " with a trailing space.