Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCristian Gerardo Hernandez Barrios
28,382 PointsWhat is wrong with my code?
Look my code... y use correctly the for loop... i'm missing something?
package loops
import "fmt"
func CountByThrees(start int, end int) {
for i := 3; i <= 12; i += 3{
fmt.Println(i)
}
}
1 Answer
Steven Parker
231,275 PointsYou forgot to use the function arguments.
You hard-coded a starting value of "3" and an ending value of "12".
Change your code so that it uses the arguments passed in to the function to control the start and end values.
Victor Musvibe
10,361 PointsVictor Musvibe
10,361 PointsI also don't seem to understand what could be wrong with my loop below.
and below is the Preview that reproduces what's required from the question. can someone please shed some light.
--- FAIL: ExampleCountByThrees_1 (0.00s) got:
want:
FAIL FAIL loops 0.003s