Generation

generate functionSat, 12 Nov 2022

return the average of an array of integers

func average(xs []float64) float64 { total := 0.0 for _, v := range xs { total += v } return total / float64(len(xs)) }

Want to kickstart your project?Use the new AI Studio to create your code