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 trialVanessa Rodriguez
6,685 Pointsloops
I think there's a bug with this code challenge. I tested it in the xcode playground and it doesn't what the challenge asks. Can someone help me figure out what's wrong or get it fixed?
// Enter your code below
var results: [Int] = [1,2,3,4,5,6,7,8,9,10]
for multiplier in 1...10 {
results.append(multiplier * 6)
}
print(results)
2 Answers
Alexander Davison
65,469 PointsFirst, You shouldn't edit the first line of code var results: [Int] = []
You should only add things to the body of the loop.
Second, the challenge didn't ask you to print anything.
You only need to add items to the array. Try this:
// Enter your code below
var results: [Int] = []
for multiplier in 1...10 {
results.append(multiplier * 6)
}
I hope this helps! ~Alex
Vanessa Rodriguez
6,685 PointsThat did help!!! Thank you!
Alexander Davison
65,469 PointsYour welcome
By the way, can you please provide a Best Answer for my answer so that your question will be marked as answered? Thank you very much!
~Alex