Write PassFail(scores) to count how many scores pass (60 or more) and how many fail. The results already have names, pass and fail, both starting at 0, and the bare return at the end hands them back.
PassFail([]int{75, 40, 60})→(2, 1)PassFail([]int{})→(0, 0)func PassFail(scores []int) (pass, fail int)package main
func PassFail(scores []int) (pass, fail int) {
for _, s := range scores {
// your code here: a pass adds 1 to pass, otherwise add 1 to fail
}
return
}
Run tries the examples. When they look right, Submit.