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 trialDipesh Patel
1,506 PointsI am mis-understanding the question during code challenge?
I am really not understanding the second half of this question....
// Enter your code below
var results: [Int] = []
for multiplier in 1...10{
print("\(multiplier) times 6 is \(multiplier*6)")
}
Dipesh Patel
1,506 Pointscorrect, i am totally drawing blank on append portion of the array. Ok, after re-reading your response. It doesn't want me to print it. gotcha, thanks!
3 Answers
Jeff McDivitt
23,970 Points- The challenge is not asking you to print anything; therefore, there is no need for the print statement. It is asking you to append the value to the results array
var results: [Int] = []
for multiplier in 1...10 {
results.append(multiplier * 6)
}
Dipesh Patel
1,506 PointsThanks! I misunderstood the question and was trapped in the mindset. The comments here helped.
NAVEED CHOWDHURY
1,142 PointsThanks for posting the question Dipesh, it threw me off but now that I look at Jeff's answer its makes sense. You really have to go back and forth between task 1 and 2 to get what the instructor is asking you to do.
niklasc
3,025 Pointsniklasc
3,025 PointsThis question (which, if I remember correctly, is the second question of this type, the first being the multiple of 5 one) wants you to append the result from the loop into an array as opposed to printing it out.