Kodewick
Start learning →
Starter←→0 / 70

A new hero

#049StarterStructs2 min

A new hero has joined the game. h is an empty Hero: set its Name to "Pip" and its Level to 3, and the line below will show Pip Lv.3.

Should show
Pip Lv.3
main.go
package main

import "fmt"

type Hero struct {
	Name  string
	Level int
}

func main() {
	var h Hero
	// your code here: set h.Name and h.Level
	fmt.Printf("%s Lv.%d\n", h.Name, h.Level)
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.