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 trialCaden Watson
6,154 PointsIm having trouble with the second task of this code challenge
This is the code im trying to run // Enter your code below var results: [Int] = [1,2,3,4,5,6,7,8,9,10] for multiplier in results { results += [results[multiplier] * 6] }
1 Answer
Binyamin Friedman
14,615 PointsCould you post a link to the challenge? What language is this in? If it's Java then there are many problems.
Magnus Hållberg
17,232 PointsMagnus Hållberg
17,232 PointsSince Android is not what Im studying I could be wrong but I think that this line is the problem:
results += [results[multiplier] * 6]
I think it should be like this instead:
results += results[multiplier] * 6
At least this would work in Swift.