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 trialnicole lumpkin
Courses Plus Student 5,328 PointsWhy wouldn't the constant coordinatePoint need to be a var since it takes on a new value each time though the loop?
Wouldn't we we be reassigning coordinatePoint a new value each time around the loop? Each time we go around coordinatePoint takes on a new value and we then append said value into our accumulator array, results. FYI I'm a Python beginner. If this were coded in Python the variable coordinatePoint would be reassigned each time around the loop. So what is happening here!?! :)
nicole lumpkin
Courses Plus Student 5,328 Pointsnicole lumpkin
Courses Plus Student 5,328 Pointsstruct Point { let x: Int let y: Int func points(inRange range: Int = 1) -> [Point] { var results = Point
}