Kodewick
Start learning →
Basic←→0 / 70

Step table

#008BasicOutputLoops4 min

The fitness band saved three days of steps. Inside the loop, use fmt.Printf to show one line per day: days[i], a space, then steps[i] with %5d. %5d gives the number 5 places, right-aligned, so the last digits line up.

Should show
Mon  8120
Tue   950
Wed 12000
main.go
package main

import "fmt"

func main() {
	days := []string{"Mon", "Tue", "Wed"}
	steps := []int{8120, 950, 12000}
	for i := 0; i < len(days); i++ {
		// your code here: fmt.Printf days[i], a space and steps[i] with %5d
	}
}
Ctrl + Enter runs too
Result

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