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 trialDawson Young
512 PointsSuper lost on this code challenge :(...
Cannot figure out the last part of this step
// Enter your code below
var results: [Int] = []
for multiplier in 1...10 {
"\(multiplier) times 6 is equal to \(multiplier * 6)"
}
results.append(multiplier)
2 Answers
Tobias Helmrich
31,603 PointsHey Dawson,
the problem is that you're appending the multiplier to the results array outside of the for in loop where the multiplier doesn't exist. Also you would just be appending the multiplier but not the multiples of 6. You should append the multiples of 6 to the array inside of the for in loop which you do like this:
// Enter your code below
var results: [Int] = []
for multiplier in 1...10 {
results.append(multiplier * 6)
}
I hope that helps, if you have further questions feel free to ask! :)
Kevin Elliott
15,653 PointsIt's unclear here what you need to do. What is the problem statement?
Dawson Young
512 PointsDawson Young
512 PointsWOW that makes sense now. Thanks Tobias you are a huge help bro!!!!!!!! You're really good at coding
Tobias Helmrich
31,603 PointsTobias Helmrich
31,603 PointsHaha, thanks for the compliment! :) I'm always happy to help and I'm glad that it makes sense for you now!