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 trialHarshit Dixit
519 PointsError : Your code couldn't be complied . But if run it in Xcode playground it runs nicely
let multiplier = 6 for table in 1...10 { print["(table) times 6 , which is equal to (multiplier*table)"]
}
// Enter your code below
let multiplier = 6
for table in 1...10 {
Print["\(table) times 6 , which is equal to \(multiplier*table)"]
}
1 Answer
Rickey Paape
24,122 PointsThere are a few things.
- The constant on the for loop should be
multiplier
instead oftimes
- The task asks you too append the results array with the multiplier * 6
As for why it won't compile, this is just an assumption, but the coding emulator on the site may not support operations when doing string interloping. If you replace the print statement with the append property on the array it should compile.