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 trialEdwin Brown
Courses Plus Student 1,787 PointsI do not understanding what is being ask for the question.
No additional question
// Enter your code below
var results: [Int] = [1,2,3,4,5,6]
let multiplier: Int
for multiplier in results { print(results[1...10] )
}
2 Answers
Arvin San Miguel
Courses Plus Student 3,160 PointsHi Edwin, It's asking you to put the results of the multiplication table of 6 in the results Array.
// Enter your code below
var results: [Int] = []
for multiplier in 1...10 {
var result: Int = multiplier * 6 // I used this variable in order to return the value and append it to the Results array.
print("6 * (multiplier)" + " = (multiplier*6)")
results.append(result)
}
Try this code. Hope this will help you.
Digvijay Jaiswal
5,565 PointsArvin San Miguel your answer is correct. I am just putting it in readable format.
var results: [Int] = []
for multiplier in 1...10 {
var result: Int = multiplier * 6 // I used this variable in order to return the value and append it to the Results array.
print("6 * (multiplier)" + " = (multiplier*6)")
results.append(result) }
Digvijay Jaiswal
5,565 PointsDigvijay Jaiswal
5,565 PointsWhat are you trying to achieve here?