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 trialXavier Finch
1,907 PointsI'm having trouble understanding how to append the value of the results to pass the 2nd part of the chanllenge
When I'm trying t complete the challenge var results: [Int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]for multiplier in results { print("(multiplier) times 6 is equal to (multiplier * 6)") }
I keep getting the error that says make sure you are storing the multiplier up to times in the results. I've tried several times. Still cant get it
2 Answers
Alia Khan
3,733 PointsHi try this :)
var results: [Int] = []
for multiplier in 1...10{
multiplier * 6
results.append(multiplier * 6) }
Xavier Finch
1,907 Pointsthanks.. that works!! Much appreciated
Alia Khan
3,733 Pointsno worries let me know if you need help with anything :)
George Drachas
4,485 PointsGeorge Drachas
4,485 Pointsthis will make it 20 times! because you write 2 times the "multiplier * 6" the right is
var results: [Int] = []
for multiplier in 1...10 {results.append(multiplier * 6) }
(the code challenge don't recognise it! both are right for the code challenge ..but if you write it to the xcode you will see the deference.)