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 trialAdam Blomberg
700 Pointsfor-in loop, swift. I don't really know how to pass this challenge.
Hi, i'm not really that kind of person who can solve so many things on my own so i don't actually know how to solve this challenge for my own. This was what i thought suit best.
for number in 1...10 {
print("\(number) \(number*7")
}
1 Answer
Kourosh Raeen
23,733 PointsFirst of all, you are missing a close parenthesis around number*7. Then use println instead of print so that each line is on a new line. Finally, make sure you are printing each line exactly as requested. Right now * 7 = is missing from your output. Here's the code:
for number in 1...10 {
println("\(number) * 7 = \(number*7)")
}
Adam Blomberg
700 PointsAdam Blomberg
700 PointsThank you, i wrote this fast just to have something to show you. Anyway i always forget to write 'println' because in Swift 2.0 you don't need it.