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 trialben sasser
476 PointsIm struggling haha....
Just a little bit confused on what exactly it wants me to do... Ive written the append statement but I don't know what to put inside of the array...
// Enter your code below
var results: [Int] = [6]
for multiplier in 1...10 {print ("\(multiplier)times 6 is equal to\(multiplier * 6)")}
results.append []
2 Answers
Unsubscribed User
24,880 PointsYou were close! The results array should stay empty because you eventually need to append numbers to it.
You got the first part of the for in loop correct. However, inside of the parenthesis, you are appending the product of the multiplier (the numbers in the range 1-10) times 6 to the results array.
I hope this makes sense!
var results: [Int] = []
for multiplier in 1...10 {
results.append(multiplier * 6)
}
James Knight
4,680 Pointsvar results: [Int] = []
for multiplier in 1...10 { results.append(multiplier * 6) }
I Hope this helps you James
ben sasser
476 Pointsthank you so much!
ben sasser
476 Pointsben sasser
476 Pointsthank you so much!