I have checked the language spec - is there a simpler way to say this:
for _, month := range []int{4,6,9,11} {
fmt.Print(month, " ")
}
I'm (ideally) looking for something like (I know this isn't Go)
for month in [4,6,9,11] {
fmt.Print(month, " ")
}
I know I can do:
days30 := []int{4,6,9,11}
for i := range days30 {
fmt.Print(days30[i], " ")
}
But this is less readible...
Note: This is for teaching purposes - so I'm looking for a simple, self contained solution for students - nothing too advanced please.