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 trial

iOS Swift Basics (retired) Control Flow For-In Loop

Jacob Tennyson
Jacob Tennyson
6,240 Points

Not sure...

What am i doing wrong?

for number in 1...10{ println('(number) times 7 is \ (10 times) (number*7)") }

Jhoan Arango
Jhoan Arango
14,575 Points

Hello Jacob:

Try posting your code on here so that we can assist you with your answer.

Jacob Tennyson
Jacob Tennyson
6,240 Points
for number in 1..<10{
  println("\(number) times 7 is \ (10 times)
  (number*7)")
}

1 Answer

Jhoan Arango
Jhoan Arango
14,575 Points

Hello:

Ok so you were close, but we have to modified your code just a bit.

for number in 1...10{
    println("\(number) * 7 = \(number * 7)")
}

It seems like you get the basics of a loop, but you seem to be a bit confused with the string interpolation.

If you need more help let me know.

Good luck