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 2.0 Collections and Control Flow Control Flow With Loops While and Repeat While

NIKOLA RUSEV
NIKOLA RUSEV
5,293 Points

x++ (consecutive statment on a line must be separeted by ";")

when i write a code without hit enter playground say ( consecutive statment on a line must be separeted by ";") and when i separete te results i 42 times not like in video 21 times. why?

Post your code.

1 Answer

I see what you mean. You are still actually getting 21 times. It is printing 21 times and incrementing 21 times so when they are on the same line it becomes 42 times. If you check the debug area at bottom it did in fact only print out 21 times.